pyumldiagrams.pdf.PdfDiagram

Attributes

NOTE_NOTCH_SIDE_Y_PERCENTAGE_LENGTH

NOTE_NOTCH_TOPX_PERCENTAGE_LENGTH

Classes

PdfDiagram

Always lays out in portrait mode. Currently, only supports UML classes with methods. Only supports

Module Contents

pyumldiagrams.pdf.PdfDiagram.NOTE_NOTCH_SIDE_Y_PERCENTAGE_LENGTH = 0.16
pyumldiagrams.pdf.PdfDiagram.NOTE_NOTCH_TOPX_PERCENTAGE_LENGTH = 0.9
class pyumldiagrams.pdf.PdfDiagram.PdfDiagram(fileName: str, dpi: int, docDisplayMethodParameters: pyumldiagrams.Definitions.DisplayMethodParameters = DisplayMethodParameters.DISPLAY, headerText: str = '')

Bases: pyumldiagrams.BaseDiagram.BaseDiagram

Inheritance diagram of pyumldiagrams.pdf.PdfDiagram.PdfDiagram

Always lays out in portrait mode. Currently, only supports UML classes with methods. Only supports inheritance, composition, aggregation, and association lines.

You are allowed to set the gap between UML classes both horizontally and vertically. Also, you are allowed to specify the text font size

Parameters:
  • fileName – Fully qualified file name

  • dpi – dots per inch for the display we are mapping from

  • docDisplayMethodParameters – The global value to consult if a class value says UNSPECIFIED

  • headerText – The header to place on the page

FPDF_DRAW: str = 'D'
RESOURCES_PACKAGE_NAME: Final = 'pdf.resources'
RESOURCES_PATH: Final = 'pdf/resources'
X_NUDGE_FACTOR: Final = 4
Y_NUDGE_FACTOR: Final = 4
FIRST_METHOD_Y_OFFSET: Final = 7
NOTE_X_OFFSET: Final = 10.0
logger: logging.Logger
property docTimeStamp: datetime.datetime

Overrides the empty base implementation

retrieveResourcePath(bareFileName: str) str

Overrides the empty base implementation

Parameters:

bareFileName

Returns: a fully qualified name

drawClass(classDefinition: pyumldiagrams.Definitions.ClassDefinition)

Draw the class diagram defined by the input

Parameters:

classDefinition – The class definition

drawUmlLine(lineDefinition: pyumldiagrams.Definitions.UmlLineDefinition)

Draw the inheritance, aggregation, or composition lines that describe the relationships between the UML classes

Parameters:

lineDefinition – A UML Line definition

drawNote(noteDefinition: pyumldiagrams.Definitions.NoteDefinition)

Draw a UML Note

Must be overridden by implementors

Parameters:

noteDefinition – A UML Note definition

drawUmlLollipop(umlLollipopDefinition: pyumldiagrams.Definitions.UmlLollipopDefinition)

Draw a UML Lollipop interface

Must be overridden by implementors

Parameters:

umlLollipopDefinition – A UML Lollipop Interface definition

drawEllipse(definition: pyumldiagrams.Definitions.EllipseDefinition)

Draw a general purpose ellipse

Parameters:

definition – It’s definition

drawRectangle(definition: pyumldiagrams.Definitions.RectangleDefinition)

Draw a general purpose rectangle

Parameters:

definition – The rectangle definition

drawText(position: pyumldiagrams.Definitions.Position, text: str)

Draw text at the input position. The method will appropriately convert the position to PDF points

Parameters:
  • position – The display’s x, y position

  • text – The text to display

write()

Call this method when you are done with placing the diagram onto a PDF document.