Package jadex.tools.comanalyzer
Class ComanalyzerPlugin
- java.lang.Object
-
- jadex.base.gui.plugin.AbstractJCCPlugin
-
- jadex.tools.comanalyzer.ComanalyzerPlugin
-
- All Implemented Interfaces:
IControlCenterPlugin,IPropertiesProvider
public class ComanalyzerPlugin extends AbstractJCCPlugin
The comanalyzer plugin.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jadex.base.gui.plugin.AbstractJCCPlugin
AbstractJCCPlugin.ShowRemoteControlCenterHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected ComponentFilter[]agentfilterThe global agentfilterprotected ToolTabchartprotected javax.swing.JCheckBoxMenuItem[]checkboxesThe checkbox items for selecting default values.protected IClockServiceclockserviceThe clock service.protected static java.lang.StringCOMANALYZER_IMAGESThe icon pathsprotected ComponentListcomponentlistThe global list of recognized agents.protected ComponentTreePanelcomptreeThe agent tree table.protected ToolTabdiagramprotected ToolTabgraphprotected static javax.swing.UIDefaultsiconsThe image icons.protected MessageFilter[]messagefilterThe global messagefilterprotected MessageListmessagelistThe global list of recorded messages.protected booleanobserve_all_newObserve all new agents.protected java.util.Set<IComponentIdentifier>observedThe set of registered agent adapters.protected PaintMapspaintmapsThe map of shared colors for message and agent representation..protected RefreshTaskrefresh_taskThe refresh task.protected static longREFRESH1Refresh every 1 secondprotected static longREFRESH10Refresh every 10 secondsprotected static longREFRESH5Refresh every 5 secondsprotected static longREFRESHARefresh auto sensored (experimental).protected static longREFRESHIRefresh immediately.protected longsleepHow long should the refresh process waitprotected javax.swing.JSplitPanesplitThe split panel.protected java.util.Map<IComponentIdentifier,ISubscriptionIntermediateFuture<java.lang.Object>>subscriptionsThe observed components.protected ToolTabtableThe ToolTabs.protected java.util.TimertimerTimer for RefreshTaskprotected ToolPaneltpanelThe ToolPanel.protected static java.lang.String[]TYPESThe system event types.protected static ComponentFilter[]zeromessagesThe agentfilter for zero messages-
Fields inherited from class jadex.base.gui.plugin.AbstractJCCPlugin
jcc
-
-
Constructor Summary
Constructors Constructor Description ComanalyzerPlugin()Create a new comanalyzer plugin.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddEvent(java.lang.Object event)Entry point for agent notifications, called from swing thread.protected voidaddMessageListener(java.util.List<Component> added)Update message listeners after agents have been added.voidagentBorn(IComponentDescription ad)Add the agent to the agentlistvoidagentChanged(IComponentDescription ad)voidagentDied(IComponentDescription ad)Remove listeners and set agent state.voidapplyAgentFilter()Applies the current agentfilter to all agents.protected voidapplyAgentFilter(Component agent)Applies the current agentfilter to a single agent.protected voidapplyAgentFilter(Component[] agents)Applies the current agentfilter to the given agents.voidapplyMessageFilter()Applies the current messagefilter to all messages.protected voidapplyMessageFilter(Message message)Applies the current messagefilter to a single message.protected voidapplyMessageFilter(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 MessagecreateMessage(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.protected IFiltercreateMessageFilter(java.util.Set agents)Create a transferable filter for a remote message listener.javax.swing.JComponent[]createToolBar()Create tool bar.javax.swing.JComponentcreateView()Create main panel.ComponentFilter[]getAgentFilter()ComponentListgetAgentList()Component[]getAgents()MessagegetMessage(int messageNr)MessageFilter[]getMessageFilter()MessageListgetMessageList()Message[]getMessages()java.lang.StringgetName()Return the unique name of this plugin.PaintMapsgetPaintMaps()IFuture<Properties>getProperties()Get plugin properties to be saved in a project.javax.swing.IcongetToolIcon(boolean selected)Return the icon representing this plugin.IFuture<java.lang.Void>init(IControlCenter jcc)Initialize the plugin.booleanisAddMessage(IComponentIdentifier s, java.lang.Object rs)Invoked when a message event has been received.protected booleanisDuplicate(java.lang.String xid, IComponentIdentifier rec)Checks if this message is already in messagelist (same id and same receiver)voidremoveAgentFilter()Remove all agent filter except for the standard filters that are accessible by the standard tool tab toolbar.voidremoveMessageFilter()Removes the current messagefilter.protected voidremoveMessageListener(java.util.List removed)Update message listeners after agents have been removed.protected voidscheduleAutoRefresh()Schedule the refresh time by retrieving the last duration for the update of the tools.voidsetAgentFilter(ComponentFilter[] filter)Sets a new agentfilter.voidsetMessageFilter(MessageFilter[] filter)IFuture<java.lang.Void>setProperties(Properties props)Set plugin properties loaded from a project.IFuture<java.lang.Void>shutdown()Shutdown the plugin.-
Methods inherited from class jadex.base.gui.plugin.AbstractJCCPlugin
getClassLoader, getJCC, getMenuBar, getToolBar, getView, isLazy, pushPlatformSettings
-
-
-
-
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.
-
REFRESHI
protected static final long REFRESHI
Refresh immediately.- See Also:
- Constant Field Values
-
REFRESH1
protected static final long REFRESH1
Refresh every 1 second- See Also:
- Constant Field Values
-
REFRESH5
protected static final long REFRESH5
Refresh every 5 seconds- See Also:
- Constant Field Values
-
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.
-
comptree
protected ComponentTreePanel comptree
The agent tree table.
-
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
-
graph
protected ToolTab graph
-
chart
protected ToolTab chart
-
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.
-
subscriptions
protected java.util.Map<IComponentIdentifier,ISubscriptionIntermediateFuture<java.lang.Object>> subscriptions
The observed components.
-
clockservice
protected IClockService clockservice
The clock service.
-
-
Method Detail
-
init
public IFuture<java.lang.Void> init(IControlCenter jcc)
Initialize the plugin.- Specified by:
initin interfaceIControlCenterPlugin- Overrides:
initin classAbstractJCCPlugin
-
shutdown
public IFuture<java.lang.Void> shutdown()
Shutdown the plugin.- Specified by:
shutdownin interfaceIControlCenterPlugin- Overrides:
shutdownin classAbstractJCCPlugin
-
getProperties
public IFuture<Properties> getProperties()
Get plugin properties to be saved in a project.- Specified by:
getPropertiesin interfaceIPropertiesProvider- Overrides:
getPropertiesin classAbstractJCCPlugin
-
setProperties
public IFuture<java.lang.Void> setProperties(Properties props)
Set plugin properties loaded from a project.- Specified by:
setPropertiesin interfaceIPropertiesProvider- Overrides:
setPropertiesin classAbstractJCCPlugin
-
getName
public java.lang.String getName()
Description copied from interface:IControlCenterPluginReturn 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:IControlCenterPluginReturn 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:
createToolBarin classAbstractJCCPlugin- Returns:
- The tool bar.
-
createMenuBar
public javax.swing.JMenu[] createMenuBar()
Create menu bar.- Overrides:
createMenuBarin classAbstractJCCPlugin- Returns:
- The menu bar.
-
createView
public javax.swing.JComponent createView()
Create main panel.- Overrides:
createViewin classAbstractJCCPlugin- 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:
trueif 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.
-
-