|
|
@@ -87,9 +87,11 @@ class Parser:
|
|
|
@staticmethod
|
|
|
def parse_object(oroot):
|
|
|
croot = oroot.find(".//mxCell")
|
|
|
- id = oroot.attrib['id']
|
|
|
- properties = {k:v for k,v in oroot.attrib.items() if k != "id"}
|
|
|
- return Parser.parse_cell(croot, id, properties)
|
|
|
+ id = oroot.attrib.get('id')
|
|
|
+ label = oroot.attrib.get('label')
|
|
|
+ placeholders = oroot.attrib.get('placeholders') == "1"
|
|
|
+ properties = {k:v for k,v in oroot.attrib.items() if not(k in ["id", "label", "placeholders"])}
|
|
|
+ return Parser.parse_cell(croot, id, label, placeholders, properties)
|
|
|
|
|
|
@staticmethod
|
|
|
def parse_style(style_string):
|
|
|
@@ -111,7 +113,7 @@ class Parser:
|
|
|
return Style(data=data)
|
|
|
|
|
|
@staticmethod
|
|
|
- def parse_cell(croot, id=None, properties={}):
|
|
|
+ def parse_cell(croot, id=None, label=None, placeholders=None, properties={}):
|
|
|
if id == None:
|
|
|
cid = croot.attrib.get("id")
|
|
|
else:
|
|
|
@@ -128,13 +130,13 @@ class Parser:
|
|
|
source = croot.attrib.get("source", None)
|
|
|
target = croot.attrib.get("target", None)
|
|
|
|
|
|
- return Edge(cid, value, parent, [], properties, style, atts, geom, source, target)
|
|
|
+ return Edge(cid, value, label, placeholders, parent, [], properties, style, atts, geom, source, target)
|
|
|
|
|
|
geom = Parser.parse_cell_geometry(croot.find(".//mxGeometry"))
|
|
|
if geom != None:
|
|
|
- return Vertex(cid, value, parent, [], properties, style, atts, geom, [], [])
|
|
|
+ return Vertex(cid, value, label, placeholders, parent, [], properties, style, atts, geom, [], [])
|
|
|
else:
|
|
|
- return Cell(cid, value, parent, [], properties, style, atts)
|
|
|
+ return Cell(cid, value, label, placeholders, parent, [], properties, style, atts)
|
|
|
|
|
|
@staticmethod
|
|
|
def parse_components(nroot, cell_dict):
|