How to use the gaphor.UML.format function in gaphor

To help you get started, we’ve selected a few gaphor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gaphor / gaphor / gaphor / diagram / compartment.py View on Github external
def render(self):
        """
        Return a rendered feature, as a string.
        """
        return UML.format(self.subject) or ""
github gaphor / gaphor / gaphor / diagram / classes / classespropertypages.py View on Github external
def _get_rows(self):
        for operation in self._item.subject.ownedOperation:
            yield [
                UML.format(operation),
                operation.isAbstract,
                operation.isStatic,
                operation,
            ]
github gaphor / gaphor / gaphor / diagram / classes / klass.py View on Github external
        return lambda: UML.format(
            operation, visibility=True, type=True, multiplicity=True, default=True
        )
github gaphor / gaphor / gaphor / adapters / propertypages.py View on Github external
def handler(event):
            if not entry.props.has_focus:
                entry.handler_block(changed_id)
                entry.set_text(
                    UML.format(
                        self.subject,
                        visibility=True,
                        is_derived=True,
                        multiplicity=True,
                    )
                    or ""
                )
                # entry.set_text(UML.format(self.subject, multiplicity=True) or '')
                entry.handler_unblock(changed_id)
github gaphor / gaphor / gaphor / diagram / classes / classespropertypages.py View on Github external
def _set_object_value(self, row, col, value):
        operation = row[-1]
        if col == 0:
            UML.parse(operation, value)
            row[0] = UML.format(operation)
        elif col == 1:
            operation.isAbstract = not operation.isAbstract
            row[1] = operation.isAbstract
        elif col == 2:
            operation.isStatic = not operation.isStatic
            row[2] = operation.isStatic
        elif col == 3:
            row[0] = UML.format(operation)
            row[1] = operation.isAbstract
            row[2] = operation.isStatic
github gaphor / gaphor / gaphor / diagram / editors.py View on Github external
def get_text(self):
        assert self._edit
        return UML.format(editable(self._edit.subject))