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.AbstractJCCPluginAbstractJCCPlugin.ShowRemoteControlCenterHandler
 
- 
 - 
Field SummaryFields 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.AbstractJCCPluginjcc
 
- 
 - 
Constructor SummaryConstructors Constructor Description ComanalyzerPlugin()Create a new comanalyzer plugin.
 - 
Method SummaryAll 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.AbstractJCCPlugingetClassLoader, getJCC, getMenuBar, getToolBar, getView, isLazy, pushPlatformSettings
 
- 
 
- 
- 
- 
Field Detail- 
TYPESprotected static final java.lang.String[] TYPES The system event types.
 - 
COMANALYZER_IMAGESprotected static final java.lang.String COMANALYZER_IMAGES The icon paths- See Also:
- Constant Field Values
 
 - 
iconsprotected static final javax.swing.UIDefaults icons The image icons.
 - 
REFRESHIprotected static final long REFRESHI Refresh immediately.- See Also:
- Constant Field Values
 
 - 
REFRESH1protected static final long REFRESH1 Refresh every 1 second- See Also:
- Constant Field Values
 
 - 
REFRESH5protected static final long REFRESH5 Refresh every 5 seconds- See Also:
- Constant Field Values
 
 - 
REFRESH10protected static final long REFRESH10 Refresh every 10 seconds- See Also:
- Constant Field Values
 
 - 
REFRESHAprotected static final long REFRESHA Refresh auto sensored (experimental).- See Also:
- Constant Field Values
 
 - 
sleepprotected long sleep How long should the refresh process wait
 - 
timerprotected java.util.Timer timer Timer for RefreshTask
 - 
refresh_taskprotected RefreshTask refresh_task The refresh task.
 - 
splitprotected javax.swing.JSplitPane split The split panel.
 - 
comptreeprotected ComponentTreePanel comptree The agent tree table.
 - 
checkboxesprotected javax.swing.JCheckBoxMenuItem[] checkboxes The checkbox items for selecting default values.
 - 
tpanelprotected ToolPanel tpanel The ToolPanel.
 - 
tableprotected ToolTab table The ToolTabs.
 - 
diagramprotected ToolTab diagram 
 - 
graphprotected ToolTab graph 
 - 
chartprotected ToolTab chart 
 - 
componentlistprotected ComponentList componentlist The global list of recognized agents.
 - 
messagelistprotected MessageList messagelist The global list of recorded messages.
 - 
messagefilterprotected MessageFilter[] messagefilter The global messagefilter
 - 
agentfilterprotected ComponentFilter[] agentfilter The global agentfilter
 - 
zeromessagesprotected static final ComponentFilter[] zeromessages The agentfilter for zero messages
 - 
observe_all_newprotected boolean observe_all_new Observe all new agents.
 - 
paintmapsprotected PaintMaps paintmaps The map of shared colors for message and agent representation..
 - 
observedprotected java.util.Set<IComponentIdentifier> observed The set of registered agent adapters.
 - 
subscriptionsprotected java.util.Map<IComponentIdentifier,ISubscriptionIntermediateFuture<java.lang.Object>> subscriptions The observed components.
 - 
clockserviceprotected IClockService clockservice The clock service.
 
- 
 - 
Method Detail- 
initpublic IFuture<java.lang.Void> init(IControlCenter jcc) Initialize the plugin.- Specified by:
- initin interface- IControlCenterPlugin
- Overrides:
- initin class- AbstractJCCPlugin
 
 - 
shutdownpublic IFuture<java.lang.Void> shutdown() Shutdown the plugin.- Specified by:
- shutdownin interface- IControlCenterPlugin
- Overrides:
- shutdownin class- AbstractJCCPlugin
 
 - 
getPropertiespublic IFuture<Properties> getProperties() Get plugin properties to be saved in a project.- Specified by:
- getPropertiesin interface- IPropertiesProvider
- Overrides:
- getPropertiesin class- AbstractJCCPlugin
 
 - 
setPropertiespublic IFuture<java.lang.Void> setProperties(Properties props) Set plugin properties loaded from a project.- Specified by:
- setPropertiesin interface- IPropertiesProvider
- Overrides:
- setPropertiesin class- AbstractJCCPlugin
 
 - 
getNamepublic 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()
 
 - 
getToolIconpublic 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()
 
 - 
createToolBarpublic javax.swing.JComponent[] createToolBar() Create tool bar.- Overrides:
- createToolBarin class- AbstractJCCPlugin
- Returns:
- The tool bar.
 
 - 
createMenuBarpublic javax.swing.JMenu[] createMenuBar() Create menu bar.- Overrides:
- createMenuBarin class- AbstractJCCPlugin
- Returns:
- The menu bar.
 
 - 
createViewpublic javax.swing.JComponent createView() Create main panel.- Overrides:
- createViewin class- AbstractJCCPlugin
- Returns:
- The main panel.
 
 - 
agentDiedpublic void agentDied(IComponentDescription ad) Remove listeners and set agent state.- Parameters:
- ad- The agent description of the agent that has died.
 
 - 
agentBornpublic void agentBorn(IComponentDescription ad) Add the agent to the agentlist- Parameters:
- ad- The agent description of the agent that was born.
 
 - 
agentChangedpublic void agentChanged(IComponentDescription ad) - Parameters:
- ad- The agent description of the agent that has changed.
 
 - 
getMessageFilterpublic MessageFilter[] getMessageFilter() - Returns:
- The messagefilter.
 
 - 
setMessageFilterpublic void setMessageFilter(MessageFilter[] filter) - Parameters:
- filter- The messagefilter to set.
 
 - 
removeMessageFilterpublic void removeMessageFilter() Removes the current messagefilter.
 - 
applyMessageFilterpublic void applyMessageFilter() Applies the current messagefilter to all messages.
 - 
applyMessageFilterprotected void applyMessageFilter(Message message) Applies the current messagefilter to a single message.- Parameters:
- message-
 
 - 
applyMessageFilterprotected 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.
 
 - 
getAgentFilterpublic ComponentFilter[] getAgentFilter() - Returns:
- The agentfilter.
 
 - 
setAgentFilterpublic void setAgentFilter(ComponentFilter[] filter) Sets a new agentfilter.- Parameters:
- filter- The filter to set.
 
 - 
removeAgentFilterpublic void removeAgentFilter() Remove all agent filter except for the standard filters that are accessible by the standard tool tab toolbar.
 - 
applyAgentFilterpublic void applyAgentFilter() Applies the current agentfilter to all agents.
 - 
applyAgentFilterprotected void applyAgentFilter(Component agent) Applies the current agentfilter to a single agent.- Parameters:
- agent- The agent the filter applied to.
 
 - 
applyAgentFilterprotected void applyAgentFilter(Component[] agents) Applies the current agentfilter to the given agents.- Parameters:
- agents- The agents to apply the filter to.
 
 - 
getMessageListpublic MessageList getMessageList() - Returns:
- The messagelist.
 
 - 
getMessagespublic Message[] getMessages() - Returns:
- The array of messages.
 
 - 
getMessagepublic Message getMessage(int messageNr) - Parameters:
- messageNr- The message number of the message to be returned.
- Returns:
- A specific message.
 
 - 
getAgentListpublic ComponentList getAgentList() - Returns:
- The agentlist.
 
 - 
getAgentspublic Component[] getAgents() - Returns:
- The array of agents.
 
 - 
getPaintMapspublic PaintMaps getPaintMaps() - Returns:
- The paint map.
 
 - 
addEventprotected 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.
 
 - 
isDuplicateprotected 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.
 
 - 
createMessageprotected 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:
 
 - 
scheduleAutoRefreshprotected void scheduleAutoRefresh() Schedule the refresh time by retrieving the last duration for the update of the tools.
 - 
isAddMessagepublic boolean isAddMessage(IComponentIdentifier s, java.lang.Object rs) Invoked when a message event has been received.- Parameters:
- msg- The message adapter.
 
 - 
addMessageListenerprotected void addMessageListener(java.util.List<Component> added) Update message listeners after agents have been added.
 - 
removeMessageListenerprotected void removeMessageListener(java.util.List removed) Update message listeners after agents have been removed.
 - 
createMessageFilterprotected IFilter createMessageFilter(java.util.Set agents) Create a transferable filter for a remote message listener.
 
- 
 
-