Class ComanalyzerPlugin

    • Field Detail

      • TYPES

        protected static final java.lang.String[] TYPES
        The system event types.
      • COMANALYZER_IMAGES

        protected static final java.lang.String COMANALYZER_IMAGES
        The icon paths
        See Also:
        Constant Field Values
      • icons

        protected static final javax.swing.UIDefaults icons
        The image icons.
      • REFRESH10

        protected static final long REFRESH10
        Refresh every 10 seconds
        See Also:
        Constant Field Values
      • REFRESHA

        protected static final long REFRESHA
        Refresh auto sensored (experimental).
        See Also:
        Constant Field Values
      • sleep

        protected long sleep
        How long should the refresh process wait
      • timer

        protected java.util.Timer timer
        Timer for RefreshTask
      • refresh_task

        protected RefreshTask refresh_task
        The refresh task.
      • split

        protected javax.swing.JSplitPane split
        The split panel.
      • checkboxes

        protected javax.swing.JCheckBoxMenuItem[] checkboxes
        The checkbox items for selecting default values.
      • tpanel

        protected ToolPanel tpanel
        The ToolPanel.
      • table

        protected ToolTab table
        The ToolTabs.
      • diagram

        protected ToolTab diagram
      • componentlist

        protected ComponentList componentlist
        The global list of recognized agents.
      • messagelist

        protected MessageList messagelist
        The global list of recorded messages.
      • messagefilter

        protected MessageFilter[] messagefilter
        The global messagefilter
      • agentfilter

        protected ComponentFilter[] agentfilter
        The global agentfilter
      • zeromessages

        protected static final ComponentFilter[] zeromessages
        The agentfilter for zero messages
      • observe_all_new

        protected boolean observe_all_new
        Observe all new agents.
      • paintmaps

        protected PaintMaps paintmaps
        The map of shared colors for message and agent representation..
      • observed

        protected java.util.Set<IComponentIdentifier> observed
        The set of registered agent adapters.
      • clockservice

        protected IClockService clockservice
        The clock service.
    • Constructor Detail

      • ComanalyzerPlugin

        public ComanalyzerPlugin()
        Create a new comanalyzer plugin.
    • Method Detail

      • getName

        public java.lang.String getName()
        Description copied from interface: IControlCenterPlugin
        Return the unique name of this plugin. This method may be called before init(). Used e.g. to store properties of each plugin.
        Returns:
        "Comanalyzer"
        See Also:
        IControlCenterPlugin.getName()
      • getToolIcon

        public javax.swing.Icon getToolIcon​(boolean selected)
        Description copied from interface: IControlCenterPlugin
        Return the icon representing this plugin. This method may be called before init().
        Returns:
        The icon of comanalyzer.
        See Also:
        jadex.base.gui.plugin.IControlCenterPlugin#getToolIcon()
      • createToolBar

        public javax.swing.JComponent[] createToolBar()
        Create tool bar.
        Overrides:
        createToolBar in class AbstractJCCPlugin
        Returns:
        The tool bar.
      • createMenuBar

        public javax.swing.JMenu[] createMenuBar()
        Create menu bar.
        Overrides:
        createMenuBar in class AbstractJCCPlugin
        Returns:
        The menu bar.
      • createView

        public javax.swing.JComponent createView()
        Create main panel.
        Overrides:
        createView in class AbstractJCCPlugin
        Returns:
        The main panel.
      • agentDied

        public void agentDied​(IComponentDescription ad)
        Remove listeners and set agent state.
        Parameters:
        ad - The agent description of the agent that has died.
      • agentBorn

        public void agentBorn​(IComponentDescription ad)
        Add the agent to the agentlist
        Parameters:
        ad - The agent description of the agent that was born.
      • agentChanged

        public void agentChanged​(IComponentDescription ad)
        Parameters:
        ad - The agent description of the agent that has changed.
      • getMessageFilter

        public MessageFilter[] getMessageFilter()
        Returns:
        The messagefilter.
      • setMessageFilter

        public void setMessageFilter​(MessageFilter[] filter)
        Parameters:
        filter - The messagefilter to set.
      • removeMessageFilter

        public void removeMessageFilter()
        Removes the current messagefilter.
      • applyMessageFilter

        public void applyMessageFilter()
        Applies the current messagefilter to all messages.
      • applyMessageFilter

        protected void applyMessageFilter​(Message message)
        Applies the current messagefilter to a single message.
        Parameters:
        message -
      • applyMessageFilter

        protected void applyMessageFilter​(Message[] messages)
        Applies the current messagefilter to the given messages and notifies tools about changed set of messages. Does not change the master list of messages.
        Parameters:
        messages - The messages to apply the filter to.
      • getAgentFilter

        public ComponentFilter[] getAgentFilter()
        Returns:
        The agentfilter.
      • setAgentFilter

        public void setAgentFilter​(ComponentFilter[] filter)
        Sets a new agentfilter.
        Parameters:
        filter - The filter to set.
      • removeAgentFilter

        public void removeAgentFilter()
        Remove all agent filter except for the standard filters that are accessible by the standard tool tab toolbar.
      • applyAgentFilter

        public void applyAgentFilter()
        Applies the current agentfilter to all agents.
      • applyAgentFilter

        protected void applyAgentFilter​(Component agent)
        Applies the current agentfilter to a single agent.
        Parameters:
        agent - The agent the filter applied to.
      • applyAgentFilter

        protected void applyAgentFilter​(Component[] agents)
        Applies the current agentfilter to the given agents.
        Parameters:
        agents - The agents to apply the filter to.
      • getMessageList

        public MessageList getMessageList()
        Returns:
        The messagelist.
      • getMessages

        public Message[] getMessages()
        Returns:
        The array of messages.
      • getMessage

        public Message getMessage​(int messageNr)
        Parameters:
        messageNr - The message number of the message to be returned.
        Returns:
        A specific message.
      • getAgentList

        public ComponentList getAgentList()
        Returns:
        The agentlist.
      • getAgents

        public Component[] getAgents()
        Returns:
        The array of agents.
      • getPaintMaps

        public PaintMaps getPaintMaps()
        Returns:
        The paint map.
      • addEvent

        protected void addEvent​(java.lang.Object event)
        Entry point for agent notifications, called from swing thread. Iterates the list of message attributes and creates message objects. The new messages are checked against the existing list of messages to skip such that are already in the system (like a message was first recorded form the sender than the message recorded from the receiver is skipped)
        Parameters:
        message_maps - The list of attribute maps for creating messages.
      • isDuplicate

        protected boolean isDuplicate​(java.lang.String xid,
                                      IComponentIdentifier rec)
        Checks if this message is already in messagelist (same id and same receiver)
        Parameters:
        source - The attribute map for the message.
        Returns:
        true if the message is already in the messagelist.
      • createMessage

        protected Message createMessage​(java.lang.Object event,
                                        java.lang.String xid,
                                        IComponentIdentifier sid,
                                        IComponentIdentifier rid,
                                        java.lang.Object body)
        Creates a message object with the corresponding sender and receiver agents and adds them to the message and agentlist.
        Parameters:
        source - The message attribute map.
        sid - The sender agent id.
        rid - The receivers agent id.
        Returns:
      • scheduleAutoRefresh

        protected void scheduleAutoRefresh()
        Schedule the refresh time by retrieving the last duration for the update of the tools.
      • isAddMessage

        public boolean isAddMessage​(IComponentIdentifier s,
                                    java.lang.Object rs)
        Invoked when a message event has been received.
        Parameters:
        msg - The message adapter.
      • addMessageListener

        protected void addMessageListener​(java.util.List<Component> added)
        Update message listeners after agents have been added.
      • removeMessageListener

        protected void removeMessageListener​(java.util.List removed)
        Update message listeners after agents have been removed.
      • createMessageFilter

        protected IFilter createMessageFilter​(java.util.Set agents)
        Create a transferable filter for a remote message listener.