Version: 8.3.0
gui.Appli.Appli Class Reference
Inheritance diagram for gui.Appli.Appli:
Collaboration diagram for gui.Appli.Appli:

Public Member Functions

def __init__
 
def createWidgets
 
def handlePanelChanged
 
def initActions
 
def initMenus
 
def initYACS
 
def openSalomeFile
 
def openFile
 
def newProc
 
def openFileWithLoader
 
def cata_tool
 
def view_log
 
def LR
 
def RL
 
def TB
 
def BT
 
def rankdir
 
def updateCanvas
 
def addNode
 
def zoomIn
 
def zoomOut
 
def orthoLinks
 
def clearLinks
 
def handlePreferences
 
def handleWindowMenu
 
def about
 
def aboutQt
 
def run
 
def susp
 
def step
 
def stop
 
def initToolbar
 
def initStatusbar
 

Public Attributes

 tabWidget
 
 currentPanel
 
 actions
 
 newAct
 
 prefAct
 
 runAct
 
 suspAct
 
 stepAct
 
 stopAct
 
 cataToolAct
 
 fileMenu
 
 loadersMenu
 
 loaders
 
 settingsMenu
 
 editMenu
 
 layoutMenu
 
 canvasMenu
 
 windowMenu
 
 help
 
 runtime
 
 loader
 
 executor
 
 salomeloader
 
 logFile
 
 catalogTool
 
 toolbars
 
 SBfile
 

Detailed Description

    Appli()
    Cree la fenetre principale de l'interface utilisateur

Definition at line 161 of file Appli.py.

Constructor & Destructor Documentation

def gui.Appli.Appli.__init__ (   self)

Definition at line 166 of file Appli.py.

References gui.Appli.Appli.createWidgets(), gui.Appli.Appli.initActions(), gui.Appli.Appli.initMenus(), gui.Appli.Appli.initStatusbar(), gui.Appli.Appli.initToolbar(), and gui.Appli.Appli.initYACS().

167  def __init__(self):
168  QMainWindow.__init__(self)
169  self.createWidgets()
170  self.initActions()
171  self.initMenus()
172  self.initToolbar()
173  self.initStatusbar()
174  self.initYACS()

Member Function Documentation

def gui.Appli.Appli.about (   self)

Definition at line 427 of file Appli.py.

428  def about(self):
429  QMessageBox.about(self,'YACS browser GUI', 'YACS browser GUI')
def gui.Appli.Appli.aboutQt (   self)

Definition at line 430 of file Appli.py.

431  def aboutQt(self):
432  QMessageBox.aboutQt(self,'YACS browser GUI')
def gui.Appli.Appli.addNode (   self,
  node 
)

Definition at line 391 of file Appli.py.

References gui.Appli.Appli.currentPanel.

Referenced by gui.GraphViewer.GraphViewer.popup().

392  def addNode(self,node):
393  if self.currentPanel and self.currentPanel.selected:#item selected
394  if isinstance(self.currentPanel.selected,Items.ItemComposedNode):
395  #can add node
396  self.currentPanel.selected.addNode(node)
def gui.Appli.Appli.BT (   self,
  args 
)

Definition at line 379 of file Appli.py.

References gui.Appli.Appli.rankdir().

380  def BT(self,*args ):self.rankdir("BT")
def gui.Appli.Appli.cata_tool (   self)

Definition at line 367 of file Appli.py.

368  def cata_tool(self):
370  self.catalogTool.show()
371  return
def gui.Appli.Appli.clearLinks (   self)

Definition at line 415 of file Appli.py.

References gui.Appli.Appli.currentPanel.

416  def clearLinks(self):
417  if self.currentPanel and self.currentPanel.panelManager.visible:
418  if isinstance(self.currentPanel.panelManager.visible,Items.ItemComposedNode):
419  #it is a composed node with a graph
420  self.currentPanel.panelManager.visible.graph.clearLinks()
def gui.Appli.Appli.createWidgets (   self)

Definition at line 175 of file Appli.py.

Referenced by gui.Appli.Appli.__init__().

176  def createWidgets(self):
177  self.tabWidget = QTabWidget(self)
178  self.currentPanel=None
179  self.connect(self.tabWidget, SIGNAL('currentChanged(QWidget *)'),self.handlePanelChanged)
180  self.setCentralWidget(self.tabWidget)
181  self.resize(800,600)
def gui.Appli.Appli.handlePanelChanged (   self,
  panel 
)

Definition at line 182 of file Appli.py.

References gui.Appli.Appli.currentPanel.

183  def handlePanelChanged(self,panel):
184  self.currentPanel=panel
def gui.Appli.Appli.handlePreferences (   self)

Definition at line 421 of file Appli.py.

422  def handlePreferences(self):
423  pass
def gui.Appli.Appli.handleWindowMenu (   self)

Definition at line 424 of file Appli.py.

425  def handleWindowMenu(self):
426  pass
def gui.Appli.Appli.initActions (   self)

Definition at line 185 of file Appli.py.

Referenced by gui.Appli.Appli.__init__().

186  def initActions(self):
187  self.actions = []
189  self.newAct=QAction('New', QIconSet(Icons.get_image("new")), '&New',
190  QKeySequence("CTRL+N"),self)
191  self.newAct.setStatusTip('Open an empty editor window')
192  self.newAct.setWhatsThis( """<b>New</b>"""
193  """<p>An empty editor window will be created.</p>""")
194  self.newAct.connect(self.newAct,SIGNAL('activated()'), self.newProc)
195  self.actions.append(self.newAct)
197  self.prefAct=QAction('Preferences',QIconSet(Icons.get_image("configure.png")),'&Preferences...',
198  0, self)
199  self.prefAct.setStatusTip('Set the prefered configuration')
200  self.prefAct.setWhatsThis("""<b>Preferences</b>"""
201  """<p>Set the configuration items of the application"""
202  """ with your prefered values.</p>""")
203  self.prefAct.connect(self.prefAct,SIGNAL('activated()'), self.handlePreferences)
204  self.actions.append(self.prefAct)
206  self.runAct=QAction('Run',QIconSet(Icons.get_image("run.png")),'&Run',0,self)
207  self.runAct.connect(self.runAct,SIGNAL('activated()'), self.run)
208  self.runAct.setStatusTip('Run the selected schema')
209  self.actions.append(self.runAct)
211  self.suspAct=QAction('Suspend/resume',QIconSet(Icons.get_image("suspend-resume.gif")),'&Suspend/resume',0,self)
212  self.suspAct.connect(self.suspAct,SIGNAL('activated()'), self.susp)
213  self.suspAct.setStatusTip('Suspend/resume the selected schema')
214  self.actions.append(self.suspAct)
216  self.stepAct=QAction('Step',QIconSet(Icons.get_image("steps.png")),'&Step',0,self)
217  self.stepAct.connect(self.stepAct,SIGNAL('activated()'), self.step)
218  self.stepAct.setStatusTip('Step the selected schema')
219  self.actions.append(self.stepAct)
221  self.stopAct=QAction('Stop',QIconSet(Icons.get_image("kill.png")),'&Stop',0,self)
222  self.stopAct.connect(self.stopAct,SIGNAL('activated()'), self.stop)
223  self.stopAct.setStatusTip('Stop the selected schema')
224  self.actions.append(self.stopAct)
226  self.cataToolAct=QAction('Catalog Tool',0,self,"catatool")
227  self.cataToolAct.connect(self.cataToolAct,SIGNAL('activated()'), self.cata_tool)
228  self.actions.append(self.cataToolAct)
def gui.Appli.Appli.initMenus (   self)

Definition at line 229 of file Appli.py.

Referenced by gui.Appli.Appli.__init__().

230  def initMenus(self):
231  menubar = self.menuBar()
232 
233  #menu file
234  self.fileMenu=QPopupMenu(self)
235  self.newAct.addTo(self.fileMenu)
236  self.fileMenu.insertItem("&Open", self.openFile)
237  self.fileMenu.insertItem("&Open Salome", self.openSalomeFile)
238  self.loadersMenu = QPopupMenu(self)
239  self.fileMenu.insertItem("Loaders", self.loadersMenu)
240  self.loaders=[]
241  for file in glob.glob("/local/chris/SALOME2/SUPERV/YACS/BR_CC/YACS_SRC/src/pyqt/*loader.py"):
242  d,f=os.path.split(file)
243  name=f[:-9]
244  def call_loader(event,obj=self,file=file):
245  obj.openFileWithLoader(file)
246  self.loaders.append(call_loader)
247  self.loadersMenu.insertItem(name, call_loader)
248  menubar.insertItem('&File',self.fileMenu)
249 
250  #menu settings
251  self.settingsMenu = QPopupMenu(self)
252  menubar.insertItem('&Settings', self.settingsMenu)
253  self.settingsMenu.insertTearOffHandle()
254  self.prefAct.addTo(self.settingsMenu)
255 
256  #menu Edit
257  self.editMenu = QPopupMenu(self)
258  self.editMenu.insertItem("&Add node", self.addNode)
259  menubar.insertItem('&Edit', self.editMenu)
260 
261  #menu Canvas
262  #sous menu layout
263  self.layoutMenu = QPopupMenu(self)
264  self.layoutMenu.insertItem("&Left Right", self.LR)
265  self.layoutMenu.insertItem("Right Left", self.RL)
266  self.layoutMenu.insertItem("Top Bottom", self.TB)
267  self.layoutMenu.insertItem("Bottom Top", self.BT)
268  self.canvasMenu = QPopupMenu(self)
269  self.canvasMenu.insertItem("&Zoom in", self.zoomIn)
270  self.canvasMenu.insertItem("Zoom &out", self.zoomOut)
271  self.canvasMenu.insertItem("Layout", self.layoutMenu)
272  self.canvasMenu.insertItem("Ortholinks", self.orthoLinks)
273  self.canvasMenu.insertItem("Clearlinks", self.clearLinks)
274  self.canvasMenu.insertItem("&Update", self.updateCanvas)
275  menubar.insertItem('&Canvas', self.canvasMenu)
276 
277  #menu window
278  self.windowMenu = QPopupMenu(self)
279  self.cataToolAct.addTo(self.windowMenu)
280  self.windowMenu.insertItem("&Log", self.view_log)
281  menubar.insertItem('&Window', self.windowMenu)
282  self.connect(self.windowMenu, SIGNAL('aboutToShow()'), self.handleWindowMenu)
283 
284  #menu help
285  self.help=QPopupMenu(self)
286  menubar.insertItem('&Help',self.help)
287  self.help.insertItem('&About',self.about,Qt.Key_F1)
288  self.help.insertItem('About &Qt',self.aboutQt)
def gui.Appli.Appli.initStatusbar (   self)

Definition at line 459 of file Appli.py.

Referenced by gui.Appli.Appli.__init__().

460  def initStatusbar(self):
461  sb = self.statusBar()
462  self.SBfile=QLabel(sb)
463  sb.addWidget(self.SBfile)
464  QWhatsThis.add(self.SBfile,
465  """<p>Partie de la statusbar qui donne le nom"""
466  """du fichier courant. </p>""")
467  self.SBfile.setText("")
468 
def gui.Appli.Appli.initToolbar (   self)

Definition at line 449 of file Appli.py.

Referenced by gui.Appli.Appli.__init__().

450  def initToolbar(self):
451  tb = QToolBar(self)
452  self.newAct.addTo(tb)
453  self.runAct.addTo(tb)
454  self.suspAct.addTo(tb)
455  self.stepAct.addTo(tb)
456  self.stopAct.addTo(tb)
457  self.toolbars={}
458  self.toolbars['File']=tb
def gui.Appli.Appli.initYACS (   self)

Definition at line 289 of file Appli.py.

Referenced by gui.Appli.Appli.__init__().

290  def initYACS(self):
291  import pilot
292  import loader
293  import salomeloader
294  self.runtime= pilot.getRuntime()
295  self.loader = loader.YACSLoader()
296  self.executor = pilot.ExecutorSwig()
297  self.salomeloader=salomeloader.SalomeLoader()
298  self.loader.registerProcCataLoader()
def gui.Appli.Appli.LR (   self,
  args 
)

Definition at line 376 of file Appli.py.

References gui.Appli.Appli.rankdir().

def LR(self,*args ):self.rankdir("LR")
def gui.Appli.Appli.newProc (   self)

Definition at line 335 of file Appli.py.

References gui.Appli.Appli.currentPanel, and gui.Appli.Appli.tabWidget.

336  def newProc(self):
337  r=pilot.getRuntime()
338  proc=r.createProc("pr")
339  panel=Browser(self.tabWidget,proc)
340  self.currentPanel=panel
341  self.tabWidget.addTab( panel,proc.getName())
342  self.tabWidget.showPage(panel)
def gui.Appli.Appli.openFile (   self)

Definition at line 317 of file Appli.py.

References gui.Appli.Appli.currentPanel, gui.Appli.Appli.logFile, and gui.Appli.Appli.tabWidget.

318  def openFile(self):
319  fn = QFileDialog.getOpenFileName(QString.null,QString.null,self)
320  if fn.isEmpty():
321  self.statusBar().message('Loading aborted',2000)
322  return
323  fileName = str(fn)
324  proc=self.loader.load(fileName)
325  logger=proc.getLogger("parser")
326  if logger.hasErrors():
327  self.logFile=logview.LogView()
328  self.logFile.text.setText(logger.getStr())
329  self.logFile.show()
330 
331  panel=Browser(self.tabWidget,proc)
332  self.currentPanel=panel
333  self.tabWidget.addTab( panel,os.path.basename(fileName))
334  self.tabWidget.showPage(panel)
def gui.Appli.Appli.openFileWithLoader (   self,
  file 
)

Definition at line 343 of file Appli.py.

References gui.Appli.Appli.currentPanel, gui.Appli.Appli.logFile, and gui.Appli.Appli.tabWidget.

344  def openFileWithLoader(self,file):
345  d,f=os.path.split(file)
346  sys.path.insert(0,d)
347  module=__import__(os.path.splitext(f)[0])
348  del sys.path[0]
349  loader=module.Loader()
350 
351  fn = QFileDialog.getOpenFileName(QString.null,QString.null,self)
352  if fn.isEmpty():
353  self.statusBar().message('Loading aborted',2000)
354  return
355  fileName = str(fn)
356  proc=loader.load(fileName)
357  logger=proc.getLogger("parser")
358  if logger.hasErrors():
359  self.logFile=logview.LogView()
360  self.logFile.text.setText(logger.getStr())
361  self.logFile.show()
362 
363  panel=Browser(self.tabWidget,proc)
364  self.currentPanel=panel
365  self.tabWidget.addTab( panel,os.path.basename(fileName))
366  self.tabWidget.showPage(panel)
def gui.Appli.Appli.openSalomeFile (   self)

Definition at line 299 of file Appli.py.

300  def openSalomeFile(self):
301  fn = QFileDialog.getOpenFileName(QString.null,QString.null,self)
302  if fn.isEmpty():
303  self.statusBar().message('Loading aborted',2000)
304  return
305  fileName = str(fn)
306  proc=self.salomeloader.load(fileName)
307  logger=proc.getLogger("parser")
308  if logger.hasErrors():
309  self.logFile=logview.LogView()
310  self.logFile.text.setText(logger.getStr())
311  self.logFile.show()
312 
313  panel=Browser(self.tabWidget,proc)
314  self.currentPanel=panel
315  self.tabWidget.addTab( panel,os.path.basename(fileName))
316  self.tabWidget.showPage(panel)
def gui.Appli.Appli.orthoLinks (   self)

Definition at line 409 of file Appli.py.

References gui.Appli.Appli.currentPanel.

410  def orthoLinks(self):
411  if self.currentPanel and self.currentPanel.panelManager.visible:
412  if isinstance(self.currentPanel.panelManager.visible,Items.ItemComposedNode):
413  #it is a composed node with a graph
414  self.currentPanel.panelManager.visible.graph.orthoLinks()
def gui.Appli.Appli.rankdir (   self,
  orient 
)

Definition at line 381 of file Appli.py.

References gui.Appli.Appli.currentPanel.

Referenced by gui.Appli.Appli.BT(), gui.Appli.Appli.LR(), gui.Appli.Appli.RL(), and gui.Appli.Appli.TB().

382  def rankdir(self,orient):
383  if self.currentPanel and self.currentPanel.panelManager.visible:
384  self.currentPanel.panelManager.visible.layout(orient)
def gui.Appli.Appli.RL (   self,
  args 
)

Definition at line 377 of file Appli.py.

References gui.Appli.Appli.rankdir().

def RL(self,*args ):self.rankdir("RL")
def gui.Appli.Appli.run (   self)

Definition at line 433 of file Appli.py.

References gui.Appli.Appli.currentPanel.

434  def run(self):
435  if self.currentPanel:
436  self.currentPanel.run()
def gui.Appli.Appli.step (   self)

Definition at line 441 of file Appli.py.

References gui.Appli.Appli.currentPanel.

442  def step(self):
443  if self.currentPanel:
444  self.currentPanel.step()
def gui.Appli.Appli.stop (   self)

Definition at line 445 of file Appli.py.

References gui.Appli.Appli.currentPanel.

446  def stop(self):
447  if self.currentPanel:
448  self.currentPanel.stop()
def gui.Appli.Appli.susp (   self)

Definition at line 437 of file Appli.py.

References gui.Appli.Appli.currentPanel.

438  def susp(self):
439  if self.currentPanel:
440  self.currentPanel.susp()
def gui.Appli.Appli.TB (   self,
  args 
)

Definition at line 378 of file Appli.py.

References gui.Appli.Appli.rankdir().

def TB(self,*args ):self.rankdir("TB")
def gui.Appli.Appli.updateCanvas (   self)

Definition at line 385 of file Appli.py.

386  def updateCanvas(self):
387  if self.currentPanel.selected:#item selected
388  if isinstance(self.currentPanel.selected,Items.ItemComposedNode):
389  #can update
390  self.currentPanel.selected.graph.editor.updateCanvas()
def gui.Appli.Appli.view_log (   self)

Definition at line 372 of file Appli.py.

References gui.Appli.Appli.currentPanel.

373  def view_log(self):
374  if self.currentPanel:
375  self.currentPanel.view_log()
def gui.Appli.Appli.zoomIn (   self)

Definition at line 397 of file Appli.py.

References gui.Appli.Appli.currentPanel.

398  def zoomIn(self):
399  if self.currentPanel and self.currentPanel.panelManager.visible:
400  if isinstance(self.currentPanel.panelManager.visible,Items.ItemComposedNode):
401  #we can zoom
402  self.currentPanel.panelManager.visible.graph.editor.zoomIn()
def gui.Appli.Appli.zoomOut (   self)

Definition at line 403 of file Appli.py.

References gui.Appli.Appli.currentPanel.

404  def zoomOut(self):
405  if self.currentPanel and self.currentPanel.panelManager.visible:
406  if isinstance(self.currentPanel.panelManager.visible,Items.ItemComposedNode):
407  #we can unzoom
408  self.currentPanel.panelManager.visible.graph.editor.zoomOut()

Member Data Documentation

gui.Appli.Appli.actions

Definition at line 186 of file Appli.py.

gui.Appli.Appli.canvasMenu

Definition at line 267 of file Appli.py.

gui.Appli.Appli.catalogTool

Definition at line 368 of file Appli.py.

gui.Appli.Appli.cataToolAct

Definition at line 225 of file Appli.py.

gui.Appli.Appli.currentPanel

Definition at line 177 of file Appli.py.

Referenced by gui.Appli.Appli.addNode(), gui.Appli.Appli.clearLinks(), gui.Appli.Appli.handlePanelChanged(), gui.Appli.Appli.newProc(), gui.Appli.Appli.openFile(), gui.Appli.Appli.openFileWithLoader(), gui.Appli.Appli.orthoLinks(), gui.Appli.Appli.rankdir(), gui.Appli.Appli.run(), gui.Appli.Appli.step(), gui.Appli.Appli.stop(), gui.Appli.Appli.susp(), gui.Appli.Appli.view_log(), gui.Appli.Appli.zoomIn(), and gui.Appli.Appli.zoomOut().

gui.Appli.Appli.editMenu

Definition at line 256 of file Appli.py.

gui.Appli.Appli.executor

Definition at line 295 of file Appli.py.

gui.Appli.Appli.fileMenu

Definition at line 233 of file Appli.py.

gui.Appli.Appli.help

Definition at line 284 of file Appli.py.

gui.Appli.Appli.layoutMenu

Definition at line 262 of file Appli.py.

gui.Appli.Appli.loader

Definition at line 294 of file Appli.py.

gui.Appli.Appli.loaders

Definition at line 239 of file Appli.py.

gui.Appli.Appli.loadersMenu

Definition at line 237 of file Appli.py.

gui.Appli.Appli.logFile

Definition at line 308 of file Appli.py.

Referenced by gui.Appli.Appli.openFile(), and gui.Appli.Appli.openFileWithLoader().

gui.Appli.Appli.newAct

Definition at line 188 of file Appli.py.

gui.Appli.Appli.prefAct

Definition at line 196 of file Appli.py.

gui.Appli.Appli.runAct

Definition at line 205 of file Appli.py.

gui.Appli.Appli.runtime

Definition at line 293 of file Appli.py.

gui.Appli.Appli.salomeloader

Definition at line 296 of file Appli.py.

gui.Appli.Appli.SBfile

Definition at line 461 of file Appli.py.

gui.Appli.Appli.settingsMenu

Definition at line 250 of file Appli.py.

gui.Appli.Appli.stepAct

Definition at line 215 of file Appli.py.

gui.Appli.Appli.stopAct

Definition at line 220 of file Appli.py.

gui.Appli.Appli.suspAct

Definition at line 210 of file Appli.py.

gui.Appli.Appli.tabWidget

Definition at line 176 of file Appli.py.

Referenced by gui.Appli.Appli.newProc(), gui.Appli.Appli.openFile(), and gui.Appli.Appli.openFileWithLoader().

gui.Appli.Appli.toolbars

Definition at line 456 of file Appli.py.

gui.Appli.Appli.windowMenu

Definition at line 277 of file Appli.py.


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