objects.gui.mainFrameToolWindow.mainFrameToolWindow Class Reference

This class represents the ToolTip window which is displayed when the mouse hovers over a map EndPoint. More...

Inherits objects::gui::mainFrameContainer::mainFrameContainer.

List of all members.

Public Member Functions

def __init__
def getProcName
 Given a networked Entity object, this method will return its process name.
def getForeignIP
 Given a networked Entity object, this method will return its IP Address in string format.
def getForeignPid
 Given a networked Entity object, this method will return its PID in string format.
def displayToolWindow
 Displays the ToolTip window given a list of Networked Entity objects (residing below the mouse pointer).

Public Attributes

 tipWin


Detailed Description

This class represents the ToolTip window which is displayed when the mouse hovers over a map EndPoint.

Definition at line 27 of file mainFrameToolWindow.py.


Member Function Documentation

def objects.gui.mainFrameToolWindow.mainFrameToolWindow.__init__ (   self,
  mainFrm,
  entList,
  x,
  y 
)

Definition at line 28 of file mainFrameToolWindow.py.

00028                                               :
00029         mainFrameContainer.__init__(self, mainFrm)
00030         self.displayToolWindow(entList, x, y)
00031     
00032     
    ## Given a networked Entity object, this method will return its process name

def objects.gui.mainFrameToolWindow.mainFrameToolWindow.displayToolWindow (   self,
  entList,
  x,
  y 
)

Displays the ToolTip window given a list of Networked Entity objects (residing below the mouse pointer).

Parameters:
entList List of networkedEntity objects
x Main window's X coordinate
y Main window's Y coordinate

Definition at line 58 of file mainFrameToolWindow.py.

00058                                               :        
00059                 
00060         if len(entList) == 1:
00061             networkEntity = entList[0]
00062             idleTime = time.time() - networkEntity.lastUpdateTS
00063             
00064             totalKB = float(networkEntity.totalBytes) / float(1000) 
00065             
00066             Pid = self.getForeignPid(networkEntity)
00067 
00068             
00069             tipString = "Process Name: %s\nPid:%s\nIP Address:%s\nPorts:%d/%d\nCity:%s\nCountry:%s\nlon:%d\nlat:%d\nKb Transferred:%8.3f\nIdle Time:%s" % (self.getProcName(networkEntity), Pid, self.getForeignIP(networkEntity), networkEntity.foreignPort, networkEntity.selfPort, networkEntity.foreignCity, networkEntity.foreignCountry, networkEntity.foreignLongitude, networkEntity.foreignLatitude, totalKB, timeUtil.formatTimeDiff(idleTime))                                            
00070         else:
00071             tipString = ""
00072             for _ent in entList:
00073                 idleTime = time.time() - _ent.lastUpdateTS
00074             
00075                 totalKB = float(_ent.totalBytes) / float(1000) 
00076                 Pid = self.getForeignPid(_ent)
00077                     
00078                                         
00079                 tipString += "Process Name: %s\nPid:%s\nIP Address:%s\nPorts:%d/%d\nCity:%s\nCountry:%s\nlon:%d\nlat:%d\nKb Transferred:%8.3f\nIdle Time:%s" % (self.getProcName(_ent), Pid, self.getForeignIP(_ent), _ent.foreignPort, _ent.selfPort, _ent.foreignCity, _ent.foreignCountry, _ent.foreignLongitude, _ent.foreignLatitude, totalKB, timeUtil.formatTimeDiff(idleTime))
00080                 tipString += "\n\n" 
00081                 
00082                                 
00083         self.tipWin = wx.TipWindow(self.mainFrame, tipString, 4096, wx.Rect(x - 2, y - 2,  5, 5))
00084         
00085         

def objects.gui.mainFrameToolWindow.mainFrameToolWindow.getForeignIP (   self,
  ent 
)

Given a networked Entity object, this method will return its IP Address in string format.

Parameters:
ent networkedEntity object
Returns:
String

Definition at line 43 of file mainFrameToolWindow.py.

00043                                :
00044         return ent.foreignIPAddress
00045     
00046     
    ## Given a networked Entity object, this method will return its PID in string format

def objects.gui.mainFrameToolWindow.mainFrameToolWindow.getForeignPid (   self,
  ent 
)

Given a networked Entity object, this method will return its PID in string format.

Parameters:
ent networkedEntity object
Returns:
String

Definition at line 50 of file mainFrameToolWindow.py.

00050                                 :
00051         return ent.Pid
00052 
00053 
    ## Displays the ToolTip window given a list of Networked Entity objects (residing below the mouse pointer)

def objects.gui.mainFrameToolWindow.mainFrameToolWindow.getProcName (   self,
  ent 
)

Given a networked Entity object, this method will return its process name.

Parameters:
ent networkedEntity object
Returns:
String

Definition at line 36 of file mainFrameToolWindow.py.

00036                               :
00037         return ent.processName
00038     
00039     
    ## Given a networked Entity object, this method will return its IP Address in string format


Member Data Documentation

Definition at line 83 of file mainFrameToolWindow.py.


The documentation for this class was generated from the following file:

Generated on Mon Mar 30 00:26:29 2009 for EyeSpy by  doxygen 1.5.8