Commit 1d369422 authored by Guillaume Sabbagh's avatar Guillaume Sabbagh
Browse files
parents ab08900b 0bb248cb
...@@ -134,8 +134,13 @@ class MainWindow: ...@@ -134,8 +134,13 @@ class MainWindow:
i+=1 i+=1
def exporterGraphviz(self): def exporterGraphviz(self):
#transformer_graphviz() uids=self._objFrame.getSelectedObjects()
print("Graphviz") data=self._controller.getModel().getObject(uids)
for index, row in data.iterrows():
obj=row["object"]
if callable(getattr(obj,"transformer_graphviz",None)):
obj.transformer_graphviz()
class ExportAsDialog(Toplevel): class ExportAsDialog(Toplevel):
......
...@@ -108,24 +108,29 @@ class LabelText(LabelFrame): ...@@ -108,24 +108,29 @@ class LabelText(LabelFrame):
_TEXT_MAX_SIZE=100 _TEXT_MAX_SIZE=100
_text=None _text=None
_scrollbarY=None _scrollbarY=None
_description=None
def __init__(self, parent, name:str, *args, **kwargs): def __init__(self, parent, name:str, description:str=None, *args, **kwargs):
LabelFrame .__init__(self, parent, LabelFrame .__init__(self, parent,
bd=parameters.FRAME_BD, bd=parameters.FRAME_BD,
text=name, text=name,
*args, **kwargs) *args, **kwargs)
self._description=description
self._initFrame() self._initFrame()
def _initFrame(self): def _initFrame(self):
self.columnconfigure(0, weight=1, minsize=20) self.columnconfigure(0, weight=1, minsize=20)
self.columnconfigure(1, minsize=16) self.columnconfigure(1, minsize=16)
self.rowconfigure(0, weight=1, minsize=20) self.rowconfigure(1, weight=1, minsize=20)
if self._description:
Label(self, text=self._description, anchor="w").grid(row=0, column=0, sticky="new")
self._text=Text(self) self._text=Text(self)
self._text.grid(row=0, column=0, sticky="nw") self._text.grid(row=1, column=0, sticky="nw")
self._scrollbarY=Scrollbar(self, orient =VERTICAL) self._scrollbarY=Scrollbar(self, orient =VERTICAL)
self._scrollbarY.grid(row=0, column=1, sticky="nsw") self._scrollbarY.grid(row=1, column=1, sticky="nsw")
self._text.configure(yscrollcommand = self._scrollbarY.set) self._text.configure(yscrollcommand = self._scrollbarY.set)
self._scrollbarY.config(command=self._text.yview) self._scrollbarY.config(command=self._text.yview)
...@@ -136,7 +141,7 @@ class LabelText(LabelFrame): ...@@ -136,7 +141,7 @@ class LabelText(LabelFrame):
class ObjectLabelText(LabelText): class ObjectLabelText(LabelText):
def __init__(self, parent, *args, **kwargs): def __init__(self, parent, *args, **kwargs):
LabelText .__init__(self, parent, name="Objets", *args, **kwargs) LabelText .__init__(self, parent, name="Objets", description="ex: 1,2,3...", *args, **kwargs)
def getObjectsList(self): def getObjectsList(self):
return [x for x in split('[,\n]', self.getText()) if x] return [x for x in split('[,\n]', self.getText()) if x]
...@@ -144,7 +149,7 @@ class ObjectLabelText(LabelText): ...@@ -144,7 +149,7 @@ class ObjectLabelText(LabelText):
class MorphismeLabelText(LabelText): class MorphismeLabelText(LabelText):
def __init__(self, parent, *args, **kwargs): def __init__(self, parent, *args, **kwargs):
LabelText .__init__(self, parent, name="Morphismes", *args, **kwargs) LabelText .__init__(self, parent, name="Morphismes", description="ex: (1,2,f)(2,3,g)...", *args, **kwargs)
def getMorphismesList(self): def getMorphismesList(self):
# (...) # (...)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment