public class ComanalyzerPlugin
extends jadex.base.gui.plugin.AbstractJCCPlugin
Modifier and Type | Field and Description |
---|---|
protected ComponentFilter[] |
agentfilter
The global agentfilter
|
protected ToolTab |
chart |
protected javax.swing.JCheckBoxMenuItem[] |
checkboxes
The checkbox items for selecting default values.
|
protected jadex.bridge.service.types.clock.IClockService |
clockservice
The clock service.
|
protected static java.lang.String |
COMANALYZER_IMAGES
The icon paths
|
protected ComponentList |
componentlist
The global list of recognized agents.
|
protected jadex.base.gui.componenttree.ComponentTreePanel |
comptree
The agent tree table.
|
protected ToolTab |
diagram |
protected ToolTab |
graph |
protected static javax.swing.UIDefaults |
icons
The image icons.
|
protected jadex.bridge.service.types.message.IMessageListener |
listener
The message service listener.
|
protected java.util.Map |
listeners
The currently registered listeners (listener->ComanalyzerListener).
|
protected MessageFilter[] |
messagefilter
The global messagefilter
|
protected MessageList |
messagelist
The global list of recorded messages.
|
protected java.util.Map |
msgservices
The message services (service_id->[service, observed component set]).
|
protected boolean |
observe_all_new
Observe all new agents.
|
protected java.util.Set |
observed
The set of registered agent adapters.
|
protected PaintMaps |
paintmaps
The map of shared colors for message and agent representation..
|
protected RefreshTask |
refresh_task
The refresh task.
|
protected static long |
REFRESH1
Refresh every 1 second
|
protected static long |
REFRESH10
Refresh every 10 seconds
|
protected static long |
REFRESH5
Refresh every 5 seconds
|
protected static long |
REFRESHA
Refresh auto sensored (experimental).
|
protected static long |
REFRESHI
Refresh immediately.
|
protected long |
sleep
How long should the refresh process wait
|
protected javax.swing.JSplitPane |
split
The split panel.
|
protected ToolTab |
table
The ToolTabs.
|
protected java.util.Timer |
timer
Timer for RefreshTask
|
protected ToolPanel |
tpanel
The ToolPanel.
|
protected static java.lang.String[] |
TYPES
The system event types.
|
protected static ComponentFilter[] |
zeromessages
The agentfilter for zero messages
|
Constructor and Description |
---|
ComanalyzerPlugin()
Create a new comanalyzer plugin.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addMessage(jadex.bridge.IMessageAdapter message)
Entry point for agent notifications, i.e.
|
protected void |
addMessageListener(java.util.List added)
Update message listeners after agents have been added.
|
void |
agentBorn(jadex.bridge.service.types.cms.IComponentDescription ad)
Add the agent to the agentlist
|
void |
agentChanged(jadex.bridge.service.types.cms.IComponentDescription ad) |
void |
agentDied(jadex.bridge.service.types.cms.IComponentDescription ad)
Remove listeners and set agent state.
|
void |
applyAgentFilter()
Applies the current agentfilter to all agents.
|
protected void |
applyAgentFilter(Component agent)
Applies the current agentfilter to a single agent.
|
protected void |
applyAgentFilter(Component[] agents)
Applies the current agentfilter to the given agents.
|
void |
applyMessageFilter()
Applies the current messagefilter to all messages.
|
protected void |
applyMessageFilter(Message message)
Applies the current messagefilter to a single message.
|
protected void |
applyMessageFilter(Message[] messages)
Applies the current messagefilter to the given messages and
notifies tools about changed set of messages.
|
javax.swing.JMenu[] |
createMenuBar()
Create menu bar.
|
protected Message |
createMessage(jadex.bridge.IMessageAdapter msg,
jadex.bridge.IComponentIdentifier sid,
jadex.bridge.IComponentIdentifier rid)
Creates a message object with the corresponding sender and receiver
agents and adds them to the message and agentlist.
|
protected jadex.commons.IFilter |
createMessageFilter(java.util.Set agents)
Create a transferable filter for a remote message listener.
|
javax.swing.JComponent[] |
createToolBar()
Create tool bar.
|
javax.swing.JComponent |
createView()
Create main panel.
|
ComponentFilter[] |
getAgentFilter() |
ComponentList |
getAgentList() |
Component[] |
getAgents() |
Message |
getMessage(int messageNr) |
MessageFilter[] |
getMessageFilter() |
MessageList |
getMessageList() |
Message[] |
getMessages() |
java.lang.String |
getName() |
PaintMaps |
getPaintMaps() |
jadex.commons.future.IFuture |
getProperties()
Get plugin properties to be saved in a project.
|
javax.swing.Icon |
getToolIcon(boolean selected) |
jadex.commons.future.IFuture<java.lang.Void> |
init(jadex.base.gui.plugin.IControlCenter jcc)
Initialize the plugin.
|
boolean |
isAddMessage(jadex.bridge.IMessageAdapter msg)
Invoked when a message event has been received.
|
protected boolean |
isDuplicate(jadex.bridge.IMessageAdapter newmsg,
jadex.bridge.IComponentIdentifier rec)
Checks if this message is already in messagelist (same id and same
receiver)
|
void |
removeAgentFilter()
Remove all agent filter except for the standard filters that are
accessible by the standard tool tab toolbar.
|
void |
removeMessageFilter()
Removes the current messagefilter.
|
protected void |
removeMessageListener(java.util.List removed)
Update message listeners after agents have been removed.
|
protected void |
scheduleAutoRefresh()
Schedule the refresh time by retrieving the last duration for the update
of the tools.
|
void |
setAgentFilter(ComponentFilter[] filter)
Sets a new agentfilter.
|
void |
setMessageFilter(MessageFilter[] filter) |
jadex.commons.future.IFuture |
setProperties(jadex.commons.Properties props)
Set plugin properties loaded from a project.
|
jadex.commons.future.IFuture<java.lang.Void> |
shutdown()
Shutdown the plugin.
|
protected static final java.lang.String[] TYPES
protected static final java.lang.String COMANALYZER_IMAGES
protected static final javax.swing.UIDefaults icons
protected static final long REFRESHI
protected static final long REFRESH1
protected static final long REFRESH5
protected static final long REFRESH10
protected static final long REFRESHA
protected long sleep
protected java.util.Timer timer
protected RefreshTask refresh_task
protected javax.swing.JSplitPane split
protected jadex.base.gui.componenttree.ComponentTreePanel comptree
protected javax.swing.JCheckBoxMenuItem[] checkboxes
protected ToolPanel tpanel
protected ToolTab table
protected ToolTab diagram
protected ToolTab graph
protected ToolTab chart
protected java.util.Map listeners
protected ComponentList componentlist
protected MessageList messagelist
protected MessageFilter[] messagefilter
protected ComponentFilter[] agentfilter
protected static final ComponentFilter[] zeromessages
protected boolean observe_all_new
protected PaintMaps paintmaps
protected java.util.Set observed
protected java.util.Map msgservices
protected jadex.bridge.service.types.message.IMessageListener listener
protected jadex.bridge.service.types.clock.IClockService clockservice
public jadex.commons.future.IFuture<java.lang.Void> init(jadex.base.gui.plugin.IControlCenter jcc)
init
in interface jadex.base.gui.plugin.IControlCenterPlugin
init
in class jadex.base.gui.plugin.AbstractJCCPlugin
public jadex.commons.future.IFuture<java.lang.Void> shutdown()
shutdown
in interface jadex.base.gui.plugin.IControlCenterPlugin
shutdown
in class jadex.base.gui.plugin.AbstractJCCPlugin
public jadex.commons.future.IFuture getProperties()
getProperties
in interface jadex.commons.IPropertiesProvider
getProperties
in class jadex.base.gui.plugin.AbstractJCCPlugin
public jadex.commons.future.IFuture setProperties(jadex.commons.Properties props)
setProperties
in interface jadex.commons.IPropertiesProvider
setProperties
in class jadex.base.gui.plugin.AbstractJCCPlugin
public java.lang.String getName()
IControlCenterPlugin.getName()
public javax.swing.Icon getToolIcon(boolean selected)
jadex.base.gui.plugin.IControlCenterPlugin#getToolIcon()
public javax.swing.JComponent[] createToolBar()
createToolBar
in class jadex.base.gui.plugin.AbstractJCCPlugin
public javax.swing.JMenu[] createMenuBar()
createMenuBar
in class jadex.base.gui.plugin.AbstractJCCPlugin
public javax.swing.JComponent createView()
createView
in class jadex.base.gui.plugin.AbstractJCCPlugin
public void agentDied(jadex.bridge.service.types.cms.IComponentDescription ad)
ad
- The agent description of the agent that has died.public void agentBorn(jadex.bridge.service.types.cms.IComponentDescription ad)
ad
- The agent description of the agent that was born.public void agentChanged(jadex.bridge.service.types.cms.IComponentDescription ad)
ad
- The agent description of the agent that has changed.public MessageFilter[] getMessageFilter()
public void setMessageFilter(MessageFilter[] filter)
filter
- The messagefilter to set.public void removeMessageFilter()
public void applyMessageFilter()
protected void applyMessageFilter(Message message)
message
- protected void applyMessageFilter(Message[] messages)
messages
- The messages to apply the filter to.public ComponentFilter[] getAgentFilter()
public void setAgentFilter(ComponentFilter[] filter)
filter
- The filter to set.public void removeAgentFilter()
public void applyAgentFilter()
protected void applyAgentFilter(Component agent)
agent
- The agent the filter applied to.protected void applyAgentFilter(Component[] agents)
agents
- The agents to apply the filter to.public MessageList getMessageList()
public Message[] getMessages()
public Message getMessage(int messageNr)
messageNr
- The message number of the message to be returned.public ComponentList getAgentList()
public Component[] getAgents()
public PaintMaps getPaintMaps()
protected void addMessage(jadex.bridge.IMessageAdapter message)
message_maps
- The list of attribute maps for creating messages.protected boolean isDuplicate(jadex.bridge.IMessageAdapter newmsg, jadex.bridge.IComponentIdentifier rec)
source
- The attribute map for the message.true
if the message is already in the messagelist.protected Message createMessage(jadex.bridge.IMessageAdapter msg, jadex.bridge.IComponentIdentifier sid, jadex.bridge.IComponentIdentifier rid)
source
- The message attribute map.sid
- The sender agent id.rid
- The receivers agent id.protected void scheduleAutoRefresh()
public boolean isAddMessage(jadex.bridge.IMessageAdapter msg)
msg
- The message adapter.protected void addMessageListener(java.util.List added)
protected void removeMessageListener(java.util.List removed)
protected jadex.commons.IFilter createMessageFilter(java.util.Set agents)