Version: 8.3.0
gui.Items.ItemComposedNode Class Reference
Inheritance diagram for gui.Items.ItemComposedNode:
Collaboration diagram for gui.Items.ItemComposedNode:

Public Member Functions

def __init__
 
def isExpandable
 
def getChildren
 
def dblselected
 
def selected
 
def getIconName
 
def panel
 
def addNode
 
def panel1
 
def layout
 
def addLink
 
- Public Member Functions inherited from gui.Item.Item
def __init__
 
def isExpandable
 
def getChildren
 
def father
 
def getIconName
 
def panel
 
def box
 
def selected
 
def dblselected
 

Public Attributes

 node
 
 graph
 
 label
 
 datalinks
 
 controllinks
 
 emitting
 
- Public Attributes inherited from gui.Item.Item
 label
 
 emitting
 

Static Public Attributes

int n = 0
 

Detailed Description

Item pour les noeuds composes

Definition at line 117 of file Items.py.

Constructor & Destructor Documentation

def gui.Items.ItemComposedNode.__init__ (   self,
  node 
)

Definition at line 120 of file Items.py.

121  def __init__(self,node):
122  #node is an instance of YACS::ENGINE::ComposedNode
123  Item.Item.__init__(self)
124  self.node=node
125  self.graph=None
126  self.label=node.getName()
128  self.controllinks=ControlLinksItem(self)

Member Function Documentation

def gui.Items.ItemComposedNode.addLink (   self,
  link 
)

Definition at line 198 of file Items.py.

199  def addLink(self,link):
200  print "Composed.addLink",link
201  if isinstance(link,DataLinkItem):
202  self.datalinks.addLink(link)
203  elif isinstance(link,StreamLinkItem):
204  self.datalinks.addLink(link)
205  else:
206  self.controllinks.addLink(link)
207 
def gui.Items.ItemComposedNode.addNode (   self,
  service 
)

Definition at line 176 of file Items.py.

177  def addNode(self,service):
178  print "Composed.addNode",service
179  #add node service in the parent self which is a ComposedNode
180  new_node=service.clone(None)
181  ItemComposedNode.n=ItemComposedNode.n+1
182  name=service.getName()+"_%d" % ItemComposedNode.n
183  new_node.setName(name)
184  self.node.edAddChild(new_node)
185  item=Item.adapt(new_node)
186  CONNECTOR.Emit(self,"add",item)
def gui.Items.ItemComposedNode.dblselected (   self)

Definition at line 148 of file Items.py.

References gui.Item.Item.emitting, gui.cataitems.Obj.emitting, gui.cataitems.ItemService.emitting, gui.cataitems.ItemType.emitting, gui.cataitems.ItemCompo.emitting, gui.cataitems.ItemNode.emitting, gui.cataitems.ItemComposedNode.emitting, and gui.cataitems.Cata.emitting.

149  def dblselected(self):
150  #print "ItemComposedNode dblselected"
151  root=self.node.getRootNode()
152  rootItem=Item.adapt(root)
153  if not self.emitting:
154  self.emitting=1
155  CONNECTOR.Emit(rootItem,"dblselected",self)
156  self.emitting=0
def gui.Items.ItemComposedNode.getChildren (   self)

Definition at line 132 of file Items.py.

References gui.Items.ItemComposedNode.controllinks, and gui.Items.ItemComposedNode.datalinks.

133  def getChildren(self):
134  #liste des noeuds fils
135  liste=self.node.edGetDirectDescendants()
136  #On les adapte en item avant de les retourner
137  sublist=[]
138  for n in liste:
139  try:
140  sublist.append(Item.adapt(n))
141  except:
142  #print n
143  #traceback.print_exc()
144  raise
145  sublist.append(self.datalinks)
146  sublist.append(self.controllinks)
147  return sublist
def gui.Items.ItemComposedNode.getIconName (   self)

Definition at line 166 of file Items.py.

167  def getIconName(self):
168  return "green-los"
def gui.Items.ItemComposedNode.isExpandable (   self)

Definition at line 129 of file Items.py.

130  def isExpandable(self):
131  return True
def gui.Items.ItemComposedNode.layout (   self,
  rankdir 
)

Definition at line 192 of file Items.py.

References gui.Items.ItemComposedNode.graph, and gui.graph.grid.graph.

193  def layout(self,rankdir):
194  if self.graph:
195  self.graph.layout(rankdir)
def gui.Items.ItemComposedNode.panel (   self,
  parent 
)
Retourne un tab widget pour browser/editer la proc

Definition at line 169 of file Items.py.

References gui.BoxManager.BoxManager.panels, gui.PanelManager.PanelManager.panels, gui.Items.ItemPort.panels, and gui.Items.ItemNode.panels.

170  def panel(self,parent):
171  """Retourne un tab widget pour browser/editer la proc"""
172  tabWidget = QTabWidget( parent )
173  for name,method in self.panels:
174  tabWidget.addTab( method(self,tabWidget), name )
175  return tabWidget
def gui.Items.ItemComposedNode.panel1 (   self,
  parent 
)

Definition at line 187 of file Items.py.

References gui.Items.ItemComposedNode.graph, and gui.graph.grid.graph.

188  def panel1(self,parent):
189  qvbox=QVBox(parent)
190  self.graph=graph.Graph(self,qvbox)
191  return qvbox
def gui.Items.ItemComposedNode.selected (   self)

Definition at line 157 of file Items.py.

References gui.Item.Item.emitting, gui.cataitems.Obj.emitting, gui.cataitems.ItemService.emitting, gui.cataitems.ItemType.emitting, gui.cataitems.ItemCompo.emitting, gui.cataitems.ItemNode.emitting, gui.cataitems.ItemComposedNode.emitting, and gui.cataitems.Cata.emitting.

158  def selected(self):
159  #print "ItemComposedNode selected"
160  root=self.node.getRootNode()
161  rootItem=Item.adapt(root)
162  if not self.emitting:
163  self.emitting=1
164  CONNECTOR.Emit(rootItem,"selected",self)
165  self.emitting=0

Member Data Documentation

gui.Items.ItemComposedNode.controllinks

Definition at line 127 of file Items.py.

Referenced by gui.Items.ItemComposedNode.getChildren().

gui.Items.ItemComposedNode.datalinks

Definition at line 126 of file Items.py.

Referenced by gui.Items.ItemComposedNode.getChildren().

gui.Items.ItemComposedNode.emitting

Definition at line 153 of file Items.py.

gui.Items.ItemComposedNode.graph

Definition at line 124 of file Items.py.

Referenced by gui.Items.ItemComposedNode.layout(), and gui.Items.ItemComposedNode.panel1().

gui.Items.ItemComposedNode.label

Definition at line 125 of file Items.py.

int gui.Items.ItemComposedNode.n = 0
static

Definition at line 119 of file Items.py.

gui.Items.ItemComposedNode.node

Definition at line 123 of file Items.py.


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