Version: 8.3.0
gui.GraphViewer.PortItem Class Reference
Inheritance diagram for gui.GraphViewer.PortItem:
Collaboration diagram for gui.GraphViewer.PortItem:

Public Member Functions

def __init__
 
def moveBy
 
def myMove
 
def getObj
 
def popup
 
def connect
 
def link
 
def tooltip
 

Public Attributes

 node
 
 context
 

Detailed Description

Definition at line 280 of file GraphViewer.py.

Constructor & Destructor Documentation

def gui.GraphViewer.PortItem.__init__ (   self,
  node,
  canvas 
)

Definition at line 281 of file GraphViewer.py.

282  def __init__(self,node,canvas):
283  QCanvasEllipse.__init__(self,6,6,canvas)
284  self.setPen(QPen(Qt.black))
285  self.setBrush(QBrush(Qt.red))
286  self.setZ(node.z()+1)
287  self.node=node

Member Function Documentation

def gui.GraphViewer.PortItem.connect (   self)

Definition at line 306 of file GraphViewer.py.

References gui.CItems.ControlItem.context, gui.GraphViewer.PortItem.context, and gui.CItems.PortItem.context.

Referenced by gui.browser_catalog.Browser.init().

307  def connect(self):
308  print "connect",self.context
309  self.context.connecting(self)
def gui.GraphViewer.PortItem.getObj (   self)

Definition at line 294 of file GraphViewer.py.

295  def getObj(self):
296  return self
def gui.GraphViewer.PortItem.link (   self,
  obj 
)

Definition at line 310 of file GraphViewer.py.

311  def link(self,obj):
312  print "link:",obj
def gui.GraphViewer.PortItem.moveBy (   self,
  dx,
  dy 
)

Definition at line 288 of file GraphViewer.py.

289  def moveBy(self,dx,dy):
290  self.node.moveBy(dx,dy)
def gui.GraphViewer.PortItem.myMove (   self,
  dx,
  dy 
)

Definition at line 291 of file GraphViewer.py.

292  def myMove(self,dx,dy):
293  QCanvasEllipse.moveBy(self,dx,dy)
def gui.GraphViewer.PortItem.popup (   self,
  canvasView 
)

Definition at line 297 of file GraphViewer.py.

298  def popup(self,canvasView):
299  self.context=canvasView
300  menu=QPopupMenu()
301  caption = QLabel( "<font color=darkblue><u><b>Port Menu</b></u></font>",menu )
302  caption.setAlignment( Qt.AlignCenter )
303  menu.insertItem( caption )
304  menu.insertItem("Connect", self.connect)
305  return menu
def gui.GraphViewer.PortItem.tooltip (   self,
  view,
  pos 
)

Definition at line 313 of file GraphViewer.py.

References YACS::HMI::presentationtype_parser.height(), YACS::HMI::presentationtype_parser.width(), YACS::HMI::linkPoint.x, YACS::HMI::presentationtype_parser.x(), YACS::HMI::linkPoint.y, and YACS::HMI::presentationtype_parser.y().

314  def tooltip(self,view,pos):
315  r = QRect(self.x(), self.y(), self.width(), self.height())
316  s = QString( "port: %d,%d" % (r.center().x(), r.center().y()) )
317  view.tip( r, s )

Member Data Documentation

gui.GraphViewer.PortItem.context

Definition at line 298 of file GraphViewer.py.

Referenced by gui.GraphViewer.PortItem.connect().

gui.GraphViewer.PortItem.node

Definition at line 286 of file GraphViewer.py.


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