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

Public Member Functions

def __init__ (self)
 
def createWidgets (self)
 
def handlePanelChanged (self, panel)
 
def initActions (self)
 
def initMenus (self)
 
def initYACS (self)
 
def openSalomeFile (self)
 
def openFile (self)
 
def newProc (self)
 
def openFileWithLoader (self, file)
 
def cata_tool (self)
 
def view_log (self)
 
def LR (self, *args)
 
def RL (self, *args)
 
def TB (self, *args)
 
def BT (self, *args)
 
def rankdir (self, orient)
 
def updateCanvas (self)
 
def addNode (self, node)
 
def zoomIn (self)
 
def zoomOut (self)
 
def orthoLinks (self)
 
def clearLinks (self)
 
def handlePreferences (self)
 
def handleWindowMenu (self)
 
def about (self)
 
def aboutQt (self)
 
def run (self)
 
def susp (self)
 
def step (self)
 
def stop (self)
 
def initToolbar (self)
 
def initStatusbar (self)
 

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

◆ __init__()

def gui.Appli.Appli.__init__ (   self)

Member Function Documentation

◆ about()

def gui.Appli.Appli.about (   self)

Definition at line 427 of file Appli.py.

427 def about(self):
428 QMessageBox.about(self,'YACS browser GUI', 'YACS browser GUI')
429

◆ aboutQt()

def gui.Appli.Appli.aboutQt (   self)

Definition at line 430 of file Appli.py.

430 def aboutQt(self):
431 QMessageBox.aboutQt(self,'YACS browser GUI')
432

◆ addNode()

def gui.Appli.Appli.addNode (   self,
  node 
)

Definition at line 391 of file Appli.py.

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

References gui.Appli.Appli.currentPanel.

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

◆ BT()

def gui.Appli.Appli.BT (   self,
args 
)

Definition at line 379 of file Appli.py.

379 def BT(self,*args ):self.rankdir("BT")
380

References gui.Appli.Appli.rankdir().

◆ cata_tool()

def gui.Appli.Appli.cata_tool (   self)

Definition at line 367 of file Appli.py.

367 def cata_tool(self):
368 self.catalogTool=catalog.CatalogTool(self)
369 self.catalogTool.show()
370 return
371

◆ clearLinks()

def gui.Appli.Appli.clearLinks (   self)

Definition at line 415 of file Appli.py.

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

References gui.Appli.Appli.currentPanel.

◆ createWidgets()

def gui.Appli.Appli.createWidgets (   self)

Definition at line 175 of file Appli.py.

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

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

◆ handlePanelChanged()

def gui.Appli.Appli.handlePanelChanged (   self,
  panel 
)

Definition at line 182 of file Appli.py.

182 def handlePanelChanged(self,panel):
183 self.currentPanel=panel
184

References gui.Appli.Appli.currentPanel.

◆ handlePreferences()

def gui.Appli.Appli.handlePreferences (   self)

Definition at line 421 of file Appli.py.

421 def handlePreferences(self):
422 pass
423

◆ handleWindowMenu()

def gui.Appli.Appli.handleWindowMenu (   self)

Definition at line 424 of file Appli.py.

424 def handleWindowMenu(self):
425 pass
426

◆ initActions()

def gui.Appli.Appli.initActions (   self)

Definition at line 185 of file Appli.py.

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

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

◆ initMenus()

def gui.Appli.Appli.initMenus (   self)

Definition at line 229 of file Appli.py.

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

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

◆ initStatusbar()

def gui.Appli.Appli.initStatusbar (   self)

Definition at line 459 of file Appli.py.

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

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

◆ initToolbar()

def gui.Appli.Appli.initToolbar (   self)

Definition at line 449 of file Appli.py.

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

References gui.Appli.Appli.newAct, gui.Appli.Appli.runAct, gui.Appli.Appli.stepAct, gui.Appli.Appli.stopAct, and gui.Appli.Appli.suspAct.

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

◆ initYACS()

def gui.Appli.Appli.initYACS (   self)

Definition at line 289 of file Appli.py.

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

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

◆ LR()

def gui.Appli.Appli.LR (   self,
args 
)

Definition at line 376 of file Appli.py.

376 def LR(self,*args ):self.rankdir("LR")

References gui.Appli.Appli.rankdir().

◆ newProc()

def gui.Appli.Appli.newProc (   self)

Definition at line 335 of file Appli.py.

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

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

◆ openFile()

def gui.Appli.Appli.openFile (   self)

Definition at line 317 of file Appli.py.

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

References gui.Appli.Appli.currentPanel, gui.Appli.Appli.loader, gui.Appli.Appli.logFile, gui.Appli.Appli.tabWidget, and gui.catalog.CatalogTool.tabWidget.

◆ openFileWithLoader()

def gui.Appli.Appli.openFileWithLoader (   self,
  file 
)

Definition at line 343 of file Appli.py.

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

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

◆ openSalomeFile()

def gui.Appli.Appli.openSalomeFile (   self)

Definition at line 299 of file Appli.py.

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

References gui.Appli.Appli.salomeloader.

◆ orthoLinks()

def gui.Appli.Appli.orthoLinks (   self)

Definition at line 409 of file Appli.py.

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

References gui.Appli.Appli.currentPanel.

◆ rankdir()

def gui.Appli.Appli.rankdir (   self,
  orient 
)

Definition at line 381 of file Appli.py.

381 def rankdir(self,orient):
382 if self.currentPanel and self.currentPanel.panelManager.visible:
383 self.currentPanel.panelManager.visible.layout(orient)
384

References gui.Appli.Appli.currentPanel.

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

◆ RL()

def gui.Appli.Appli.RL (   self,
args 
)

Definition at line 377 of file Appli.py.

377 def RL(self,*args ):self.rankdir("RL")

References gui.Appli.Appli.rankdir().

◆ run()

def gui.Appli.Appli.run (   self)

Definition at line 433 of file Appli.py.

433 def run(self):
434 if self.currentPanel:
435 self.currentPanel.run()
436
void * run(void *obj)
Definition: yacs_clt.cxx:54

References gui.Appli.Appli.currentPanel, and gui.Appli.Appli.run().

Referenced by gui.Appli.Appli.run().

◆ step()

def gui.Appli.Appli.step (   self)

Definition at line 441 of file Appli.py.

441 def step(self):
442 if self.currentPanel:
443 self.currentPanel.step()
444

References gui.Appli.Appli.currentPanel, and gui.Appli.Appli.step().

Referenced by gui.Appli.Appli.step().

◆ stop()

def gui.Appli.Appli.stop (   self)

Definition at line 445 of file Appli.py.

445 def stop(self):
446 if self.currentPanel:
447 self.currentPanel.stop()
448

References gui.Appli.Appli.currentPanel, and gui.Appli.Appli.stop().

Referenced by gui.Appli.Appli.stop().

◆ susp()

def gui.Appli.Appli.susp (   self)

Definition at line 437 of file Appli.py.

437 def susp(self):
438 if self.currentPanel:
439 self.currentPanel.susp()
440

References gui.Appli.Appli.currentPanel, and gui.Appli.Appli.susp().

Referenced by gui.Appli.Appli.susp().

◆ TB()

def gui.Appli.Appli.TB (   self,
args 
)

Definition at line 378 of file Appli.py.

378 def TB(self,*args ):self.rankdir("TB")

References gui.Appli.Appli.rankdir().

◆ updateCanvas()

def gui.Appli.Appli.updateCanvas (   self)

Definition at line 385 of file Appli.py.

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

References gui.Appli.Appli.currentPanel.

◆ view_log()

def gui.Appli.Appli.view_log (   self)

Definition at line 372 of file Appli.py.

372 def view_log(self):
373 if self.currentPanel:
374 self.currentPanel.view_log()
375

References gui.Appli.Appli.currentPanel, and gui.Appli.Appli.view_log().

Referenced by gui.Appli.Appli.view_log().

◆ zoomIn()

def gui.Appli.Appli.zoomIn (   self)

Definition at line 397 of file Appli.py.

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

References gui.Appli.Appli.currentPanel.

◆ zoomOut()

def gui.Appli.Appli.zoomOut (   self)

Definition at line 403 of file Appli.py.

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

References gui.Appli.Appli.currentPanel.

Member Data Documentation

◆ actions

gui.Appli.Appli.actions

Definition at line 186 of file Appli.py.

◆ canvasMenu

gui.Appli.Appli.canvasMenu

Definition at line 267 of file Appli.py.

◆ catalogTool

gui.Appli.Appli.catalogTool

Definition at line 368 of file Appli.py.

Referenced by gui.browser_session.MainBrowser.handleBut1().

◆ cataToolAct

gui.Appli.Appli.cataToolAct

Definition at line 225 of file Appli.py.

◆ currentPanel

◆ editMenu

gui.Appli.Appli.editMenu

Definition at line 256 of file Appli.py.

◆ executor

◆ fileMenu

gui.Appli.Appli.fileMenu

Definition at line 233 of file Appli.py.

◆ help

gui.Appli.Appli.help

Definition at line 284 of file Appli.py.

◆ layoutMenu

gui.Appli.Appli.layoutMenu

Definition at line 262 of file Appli.py.

◆ loader

gui.Appli.Appli.loader

Definition at line 294 of file Appli.py.

Referenced by gui.Appli.Appli.openFile().

◆ loaders

gui.Appli.Appli.loaders

Definition at line 239 of file Appli.py.

◆ loadersMenu

gui.Appli.Appli.loadersMenu

Definition at line 237 of file Appli.py.

◆ logFile

gui.Appli.Appli.logFile

Definition at line 308 of file Appli.py.

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

◆ newAct

gui.Appli.Appli.newAct

Definition at line 188 of file Appli.py.

Referenced by gui.Appli.Appli.initToolbar().

◆ prefAct

gui.Appli.Appli.prefAct

Definition at line 196 of file Appli.py.

◆ runAct

gui.Appli.Appli.runAct

Definition at line 205 of file Appli.py.

Referenced by gui.Appli.Appli.initToolbar().

◆ runtime

gui.Appli.Appli.runtime

Definition at line 293 of file Appli.py.

◆ salomeloader

gui.Appli.Appli.salomeloader

Definition at line 296 of file Appli.py.

Referenced by gui.Appli.Appli.openSalomeFile().

◆ SBfile

gui.Appli.Appli.SBfile

Definition at line 461 of file Appli.py.

◆ settingsMenu

gui.Appli.Appli.settingsMenu

Definition at line 250 of file Appli.py.

◆ stepAct

gui.Appli.Appli.stepAct

Definition at line 215 of file Appli.py.

Referenced by gui.Appli.Appli.initToolbar().

◆ stopAct

gui.Appli.Appli.stopAct

Definition at line 220 of file Appli.py.

Referenced by gui.Appli.Appli.initToolbar().

◆ suspAct

gui.Appli.Appli.suspAct

Definition at line 210 of file Appli.py.

Referenced by gui.Appli.Appli.initToolbar().

◆ tabWidget

◆ toolbars

gui.Appli.Appli.toolbars

Definition at line 456 of file Appli.py.

◆ windowMenu

gui.Appli.Appli.windowMenu

Definition at line 277 of file Appli.py.


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