161 @param path file or directory path to build the diagram from (string) |
161 @param path file or directory path to build the diagram from (string) |
162 @keyparam kwargs diagram specific data |
162 @keyparam kwargs diagram specific data |
163 @return reference to the instantiated diagram builder |
163 @return reference to the instantiated diagram builder |
164 @exception ValueError raised to indicate an illegal diagram type |
164 @exception ValueError raised to indicate an illegal diagram type |
165 """ |
165 """ |
|
166 if diagramType not in ( |
|
167 UMLDialog.ClassDiagram, UMLDialog.PackageDiagram, |
|
168 UMLDialog.ImportsDiagram, UMLDialog.ApplicationDiagram, |
|
169 UMLDialog.NoDiagram |
|
170 ): |
|
171 raise ValueError(self.tr( |
|
172 "Illegal diagram type '{0}' given.").format(diagramType)) |
|
173 |
166 if diagramType == UMLDialog.ClassDiagram: |
174 if diagramType == UMLDialog.ClassDiagram: |
167 from .UMLClassDiagramBuilder import UMLClassDiagramBuilder |
175 from .UMLClassDiagramBuilder import UMLClassDiagramBuilder |
168 return UMLClassDiagramBuilder( |
176 return UMLClassDiagramBuilder( |
169 self, self.umlView, self.__project, path, **kwargs) |
177 self, self.umlView, self.__project, path, **kwargs) |
170 elif diagramType == UMLDialog.PackageDiagram: |
178 elif diagramType == UMLDialog.PackageDiagram: |
177 self, self.umlView, self.__project, path, **kwargs) |
185 self, self.umlView, self.__project, path, **kwargs) |
178 elif diagramType == UMLDialog.ApplicationDiagram: |
186 elif diagramType == UMLDialog.ApplicationDiagram: |
179 from .ApplicationDiagramBuilder import ApplicationDiagramBuilder |
187 from .ApplicationDiagramBuilder import ApplicationDiagramBuilder |
180 return ApplicationDiagramBuilder( |
188 return ApplicationDiagramBuilder( |
181 self, self.umlView, self.__project, **kwargs) |
189 self, self.umlView, self.__project, **kwargs) |
182 elif diagramType == UMLDialog.NoDiagram: |
190 else: |
183 return None |
191 return None |
184 else: |
|
185 raise ValueError(self.tr( |
|
186 "Illegal diagram type '{0}' given.").format(diagramType)) |
|
187 |
192 |
188 def __diagramTypeString(self): |
193 def __diagramTypeString(self): |
189 """ |
194 """ |
190 Private method to generate a readable string for the diagram type. |
195 Private method to generate a readable string for the diagram type. |
191 |
196 |