Commit abd60667 authored by Francois Mares's avatar Francois Mares
Browse files

add export graphviz

parent 7323a04a
......@@ -134,8 +134,13 @@ class MainWindow:
i+=1
def exporterGraphviz(self):
#transformer_graphviz()
print("Graphviz")
uids=self._objFrame.getSelectedObjects()
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):
......
......@@ -108,24 +108,29 @@ class LabelText(LabelFrame):
_TEXT_MAX_SIZE=100
_text=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,
bd=parameters.FRAME_BD,
text=name,
*args, **kwargs)
self._description=description
self._initFrame()
def _initFrame(self):
self.columnconfigure(0, weight=1, minsize=20)
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.grid(row=0, column=0, sticky="nw")
self._text.grid(row=1, column=0, sticky="nw")
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._scrollbarY.config(command=self._text.yview)
......@@ -136,7 +141,7 @@ class LabelText(LabelFrame):
class ObjectLabelText(LabelText):
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):
return [x for x in split('[,\n]', self.getText()) if x]
......@@ -144,7 +149,7 @@ class ObjectLabelText(LabelText):
class MorphismeLabelText(LabelText):
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):
# (...)
......
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