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

Public Member Functions

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

Public Attributes

 port
 
 item
 
 node
 
 context
 

Detailed Description

Definition at line 378 of file CItems.py.

Constructor & Destructor Documentation

def gui.CItems.PortItem.__init__ (   self,
  node,
  port,
  canvas 
)

Definition at line 379 of file CItems.py.

380  def __init__(self,node,port,canvas):
381  QCanvasEllipse.__init__(self,6,6,canvas)
382  self.port=port
383  self.item=None
384  self.item=Item.adapt(self.port)
385  self.setPen(QPen(Qt.black))
386  self.setBrush(QBrush(Qt.red))
387  self.setZ(node.z()+1)
388  self.node=node

Member Function Documentation

def gui.CItems.PortItem.connect (   self)

Definition at line 407 of file CItems.py.

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

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

408  def connect(self):
409  print "PortItem.connect",self.context
410  print self.port
411  item=Item.adapt(self.port)
412  print item
413  self.context.connecting(item)
414  #self.context.connecting(self)
def gui.CItems.PortItem.getObj (   self)

Definition at line 395 of file CItems.py.

396  def getObj(self):
397  return self
def gui.CItems.PortItem.link (   self,
  obj 
)

Definition at line 415 of file CItems.py.

416  def link(self,obj):
417  print "PortItem.link:",obj
def gui.CItems.PortItem.moveBy (   self,
  dx,
  dy 
)

Definition at line 389 of file CItems.py.

390  def moveBy(self,dx,dy):
391  self.node.moveBy(dx,dy)
def gui.CItems.PortItem.myMove (   self,
  dx,
  dy 
)

Definition at line 392 of file CItems.py.

393  def myMove(self,dx,dy):
394  QCanvasEllipse.moveBy(self,dx,dy)
def gui.CItems.PortItem.popup (   self,
  canvasView 
)

Definition at line 398 of file CItems.py.

Referenced by gui.GraphViewer.GraphViewer.contentsMousePressEvent().

399  def popup(self,canvasView):
400  self.context=canvasView
401  menu=QPopupMenu()
402  caption = QLabel( "<font color=darkblue><u><b>Port Menu</b></u></font>",menu )
403  caption.setAlignment( Qt.AlignCenter )
404  menu.insertItem( caption )
405  menu.insertItem("Connect", self.connect)
406  return menu
def gui.CItems.PortItem.selected (   self)
The canvas item has been selected

Definition at line 424 of file CItems.py.

References gui.CItems.ControlItem.port, and gui.CItems.PortItem.port.

425  def selected(self):
426  """The canvas item has been selected"""
427  #print "port selected"
428  item=Item.adapt(self.port)
429  item.selected()
def gui.CItems.PortItem.tooltip (   self,
  view,
  pos 
)

Definition at line 418 of file CItems.py.

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

419  def tooltip(self,view,pos):
420  r = QRect(pos.x(),pos.y(),self.width(), self.height())
421  t=self.port.edGetType()
422  s = QString( "port: " + self.port.getName() + ":" + t.name())
423  view.tip( r, s )

Member Data Documentation

gui.CItems.PortItem.context

Definition at line 399 of file CItems.py.

Referenced by gui.GraphViewer.PortItem.connect(), and gui.CItems.PortItem.connect().

gui.CItems.PortItem.item

Definition at line 382 of file CItems.py.

gui.CItems.PortItem.node

Definition at line 387 of file CItems.py.

Referenced by gui.CItems.Cell.customEvent(), and gui.CItems.Cell.selected().

gui.CItems.PortItem.port

Definition at line 381 of file CItems.py.

Referenced by gui.CItems.PortItem.connect(), gui.sessions.Sessions.getChildren(), gui.Items.ItemOutPort.link(), gui.Items.ItemOutStream.link(), and gui.CItems.PortItem.selected().


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