|
bool | isCloneable (WidgetBase::WidgetType type) |
|
QString | normalize (QString type) |
|
UMLObject * | findObjectInList (Uml::ID::Type id, const UMLObjectList &inList) |
|
UMLObject * | findUMLObject (const UMLObjectList &inList, const QString &inName, UMLObject::ObjectType type, UMLObject *currentObj) |
|
UMLObject * | findUMLObjectRaw (const UMLObjectList &inList, const QString &name, UMLObject::ObjectType type, UMLObject *currentObj) |
|
UMLObject * | findUMLObjectRecursive (const UMLObjectList &inList, const QString &name, UMLObject::ObjectType type) |
|
UMLPackage * | rootPackage (UMLObject *obj) |
|
void | treeViewAddViews (const UMLViewList &viewList) |
|
void | treeViewChangeIcon (UMLObject *object, Icon_Utils::IconType to) |
|
void | treeViewSetCurrentItem (UMLObject *object) |
|
void | treeViewMoveObjectTo (UMLObject *container, UMLObject *object) |
|
UMLObject * | treeViewGetCurrentObject () |
|
UMLPackage * | treeViewGetPackageFromCurrent () |
|
QString | treeViewBuildDiagramName (Uml::ID::Type id) |
|
QString | uniqObjectName (UMLObject::ObjectType type, UMLPackage *parentPkg, QString prefix) |
|
QString | newTitle (UMLObject::ObjectType type) |
|
QString | newText (UMLObject::ObjectType type) |
|
QString | renameTitle (UMLObject::ObjectType type) |
|
QString | renameText (UMLObject::ObjectType type) |
|
QString | getXmiId (QDomElement element) |
|
QString | loadCommentFromXMI (QDomElement elem) |
|
bool | isCommonXMI1Attribute (const QString &tag) |
|
bool | isCommonDataType (QString type) |
|
bool | isClassifierListitem (UMLObject::ObjectType type) |
|
Uml::ModelType::Enum | guessContainer (UMLObject *o) |
|
int | stringToDirection (QString input, Uml::ParameterDirection::Enum &result) |
|
Parse_Status | parseTemplate (QString t, NameAndType &nmTp, UMLClassifier *owningScope) |
|
Parse_Status | parseAttribute (QString a, NameAndType &nmTp, UMLClassifier *owningScope, Uml::Visibility::Enum *vis) |
|
Parse_Status | parseOperation (QString m, OpDescriptor &desc, UMLClassifier *owningScope) |
|
Parse_Status | parseConstraint (QString m, QString &name, UMLEntity *owningScope) |
|
QString | psText (Parse_Status value) |
|
bool | typeIsRootView (UMLListViewItem::ListViewType type) |
|
bool | typeIsCanvasWidget (UMLListViewItem::ListViewType type) |
|
bool | typeIsFolder (UMLListViewItem::ListViewType type) |
|
bool | typeIsContainer (UMLListViewItem::ListViewType type) |
|
bool | typeIsClassifierList (UMLListViewItem::ListViewType type) |
|
bool | typeIsClassifier (UMLListViewItem::ListViewType type) |
|
bool | typeIsProperties (UMLListViewItem::ListViewType type) |
|
bool | typeIsAllowedInType (UMLListViewItem::ListViewType childType, UMLListViewItem::ListViewType parentType) |
|
bool | typeIsDiagram (UMLListViewItem::ListViewType type) |
|
Uml::ModelType::Enum | convert_DT_MT (Uml::DiagramType::Enum dt) |
|
UMLListViewItem::ListViewType | convert_MT_LVT (Uml::ModelType::Enum mt) |
|
Uml::ModelType::Enum | convert_LVT_MT (UMLListViewItem::ListViewType lvt) |
|
UMLListViewItem::ListViewType | convert_DT_LVT (Uml::DiagramType::Enum dt) |
|
UMLListViewItem::ListViewType | convert_OT_LVT (UMLObject *o) |
|
UMLObject::ObjectType | convert_LVT_OT (UMLListViewItem::ListViewType lvt) |
|
Icon_Utils::IconType | convert_LVT_IT (UMLListViewItem::ListViewType lvt, UMLObject *o) |
|
Uml::DiagramType::Enum | convert_LVT_DT (UMLListViewItem::ListViewType lvt) |
|
MultiPageDialogBase::PageType | convert_LVT_PT (UMLListViewItem::ListViewType type) |
|
Uml::ModelType::Enum | convert_OT_MT (UMLObject::ObjectType ot) |
|
QString | updateDeleteActionToString (UMLForeignKeyConstraint::UpdateDeleteAction uda) |
|
bool | typeIsAllowedInDiagram (UMLObject *o, UMLScene *scene) |
|
bool | typeIsAllowedInDiagram (UMLWidget *w, UMLScene *scene) |
|
bool | hasAssociations (UMLObject::ObjectType type) |
|
General purpose model utilities.
- Author
- Oliver Kellogg Bugs and comments to umbre.nosp@m.llo-.nosp@m.devel.nosp@m.@kde.nosp@m..org or https://bugs.kde.org
◆ NameAndType_List
◆ NameAndType_ListIt
◆ Parse_Status
Enumerator |
---|
PS_OK | Return type of parseOperation().
|
PS_Empty | |
PS_Malformed_Arg | |
PS_Unknown_ArgType | |
PS_Illegal_MethodName | |
PS_Unknown_ReturnType | |
PS_Unspecified_Error | |
◆ convert_DT_LVT()
Convert a diagram type enum to the equivalent list view type.
◆ convert_DT_MT()
Return the Model_Type which corresponds to the given DiagramType.
◆ convert_LVT_DT()
Return the DiagramType which corresponds to the given listview type.
- Parameters
-
lvt | ListViewType to convert. |
- Returns
- The Uml::DiagramType corresponding to the lvt. Returns dt_Undefined in case no mapping to DiagramType exists.
◆ convert_LVT_IT()
Return the IconType which corresponds to the given listview type.
- Parameters
-
lvt | ListViewType to convert. |
o | Optional UMLObject pointer is only used if lvt is lvt_Class: If the stereotype <<class-or-package>> is applied on the object then Icon_Utils::it_ClassOrPackage is returned. |
- Returns
- The Icon_Utils::IconType corresponding to the lvt. Returns it_Home in case no mapping to IconType exists.
◆ convert_LVT_MT()
Return the Model_Type which corresponds to the given ListViewType. Returns Uml::N_MODELTYPES if the list view type given does not map to a Model_Type.
◆ convert_LVT_OT()
Converts a list view type enum to the equivalent object type.
- Parameters
-
lvt | The ListViewType to convert. |
- Returns
- The converted ObjectType if the listview type has a UMLObject::ObjectType representation, else 0.
◆ convert_LVT_PT()
Converts a list view type enum to the equivalent settings dialog type.
- Parameters
-
type | The ListViewType to convert. |
- Returns
- The converted settings dialog type
◆ convert_MT_LVT()
Return the ListViewType which corresponds to the given Model_Type.
◆ convert_OT_LVT()
Convert an object's type to the equivalent list view type
- Parameters
-
o | Pointer to the UMLObject whose type shall be converted to the equivalent ListViewType. We cannot just pass in a UMLObject::ObjectType because a UMLFolder is mapped to different ListViewType values, depending on its location in one of the predefined modelviews (Logical/ UseCase/etc.) |
- Returns
- The equivalent ListViewType.
◆ convert_OT_MT()
Return the Model_Type which corresponds to the given ObjectType.
◆ findObjectInList()
Seek the given id in the given list of objects. Each list element may itself contain other objects and the search is done recursively.
- Parameters
-
id | The unique ID to seek. |
inList | The UMLObjectList in which to search. |
- Returns
- Pointer to the UMLObject that matches the ID (NULL if none matches).
◆ findUMLObject()
Find the UML object of the given type and name in the passed-in list.
- Parameters
-
inList | List in which to seek the object. |
inName | Name of the object to find. |
type | ObjectType of the object to find (optional.) When the given type is ot_UMLObject the type is disregarded, i.e. the given name is the only search criterion. |
currentObj | Object relative to which to search (optional.) If given then the enclosing scope(s) of this object are searched before the global scope. |
- Returns
- Pointer to the UMLObject found, or NULL if not found.
◆ findUMLObjectRaw()
Find the UML object of the given type and name in the passed-in list. This method searches for the raw name.
- Parameters
-
inList | List in which to seek the object. |
name | Name of the object to find. |
type | ObjectType of the object to find (optional.) When the given type is ot_UMLObject the type is disregarded, i.e. the given name is the only search criterion. |
currentObj | Object relative to which to search (optional.) If given then the enclosing scope(s) of this object are searched before the global scope. |
- Returns
- Pointer to the UMLObject found, or NULL if not found.
◆ findUMLObjectRecursive()
Find the UML object of the given type and name in the passed-in list. This method searches for the raw name.
- Parameters
-
inList | List in which to seek the object. |
name | Name of the object to find. |
type | ObjectType of the object to find (optional.) When the given type is ot_UMLObject the type is disregarded, i.e. the given name is the only search criterion. |
- Returns
- Pointer to the UMLObject found, or NULL if not found.
◆ getXmiId()
Return the xmi.id (XMI-1) or xmi:id (XMI-2) of a QDomElement.
◆ guessContainer()
Try to guess the correct container folder type of a UMLObject. Object types that can't be guessed are mapped to Uml::ModelType::Logical. NOTE: This function exists mainly for handling pre-1.5.5 files and should not be used for new code.
◆ hasAssociations()
return true if given object type supports associations
- Parameters
-
type | uml object type to check |
◆ isClassifierListitem()
Return true if the given object type is a classifier list item type.
◆ isCloneable()
Determines whether the given widget type is cloneable.
- Parameters
-
type | The input WidgetType. |
- Returns
- True if the given type is cloneable.
◆ isCommonDataType()
Return true if the given type is common among the majority of programming languages, such as "bool" or "boolean".
◆ isCommonXMI1Attribute()
Return true if the given tag is one of the common XMI attributes, such as: "name" | "visibility" | "isRoot" | "isLeaf" | "isAbstract" | "isActive" | "ownerScope"
◆ loadCommentFromXMI()
Return the text of an <ownedComment> XMI element from a QDomElement.
◆ newText()
Returns translated text string used by uml object related dialogs
- Parameters
-
- Returns
- translated text string
◆ newTitle()
Returns translated title string used by uml object related dialogs
- Parameters
-
- Returns
- translated title string
◆ normalize()
Normalize a type name with respect to interspersed spaces.
- Parameters
-
type | Input type name e.g. from a user text entry dialog. |
- Returns
- Normalized type name.
◆ parseAttribute()
Parses an attribute given in UML syntax.
- Parameters
-
a | Input text of the attribute in UML syntax. Example: argname : argtype |
nmTp | NameAndType returned by this method. |
owningScope | Pointer to the owning scope of the attribute. |
vis | Optional pointer to visibility (return value.) The visibility may be given at the beginning of the attribute text in mnemonic form as follows: "+" stands for public "#" stands for protected "-" stands for private "~" stands for implementation level visibility |
- Returns
- Error status of the parse, PS_OK for success.
◆ parseConstraint()
Parses a constraint.
- Parameters
-
m | Input text of the constraint |
name | The name returned by this method |
owningScope | Pointer to the owning scope of the constraint |
- Returns
- Error status of the parse, PS_OK for success.
◆ parseOperation()
Parses an operation given in UML syntax.
- Parameters
-
m | Input text of the operation in UML syntax. Example of a two-argument operation returning "void": methodname (arg1name : arg1type, arg2name : arg2type) : void |
desc | OpDescriptor returned by this method. |
owningScope | Pointer to the owning scope of the operation. |
- Returns
- Error status of the parse, PS_OK for success.
The search pattern includes everything up to the opening parenthesis because UML also permits non programming-language oriented designs using narrative names, for example "check water temperature".
◆ parseTemplate()
Parses a template parameter given in UML syntax.
- Parameters
-
t | Input text of the template parameter. Example: parname : partype or just: parname (for class type) |
nmTp | NameAndType returned by this method. |
owningScope | Pointer to the owning scope of the template param. |
- Returns
- Error status of the parse, PS_OK for success.
◆ psText()
Returns the Parse_Status as a text.
◆ renameText()
Returns translated text string used by uml object related dialogs
- Parameters
-
- Returns
- translated text string
◆ renameTitle()
Returns translated title string used by uml object related dialogs
- Parameters
-
- Returns
- translated title string
◆ rootPackage()
◆ stringToDirection()
Parse a direction string into the Uml::ParameterDirection::Enum.
- Parameters
-
- Returns
- Length of the string matched, excluding the optional whitespace.
◆ treeViewAddViews()
Add the given list of views to the tree view.
- Parameters
-
viewList | the list of views to add |
◆ treeViewBuildDiagramName()
Build the diagram name from the tree view.
The function returns a relative path constructed from the folder hierarchy.
- Parameters
-
- Returns
- the constructed diagram name
◆ treeViewChangeIcon()
Change an icon of an object in the tree view.
- Parameters
-
object | the object in the treeViewAddViews |
to | the new icon type for the given object |
◆ treeViewGetCurrentObject()
UMLObject * Model_Utils::treeViewGetCurrentObject |
( |
| ) |
|
Return the current UMLObject from the tree view.
- Returns
- the UML object of the current item
◆ treeViewGetPackageFromCurrent()
UMLPackage * Model_Utils::treeViewGetPackageFromCurrent |
( |
| ) |
|
Return the UMLPackage if the current item in the tree view is a package. Return the closest package in the tree view or NULL otherwise
- Returns
- the package or NULL
◆ treeViewMoveObjectTo()
Move an object to a new container in the tree view.
- Parameters
-
container | the new container for the object |
object | the to be moved object |
◆ treeViewSetCurrentItem()
Set the given object to the current item in the tree view.
- Parameters
-
object | the object which will be the current item |
◆ typeIsAllowedInDiagram() [1/2]
Return true if the object type is allowed in the related diagram
- Parameters
-
o | UML object instance |
scene | diagram instance |
- Returns
- true type is allowed
-
false type is not allowed
◆ typeIsAllowedInDiagram() [2/2]
Return true if the widget type is allowed in the related diagram
- Parameters
-
w | UML widget object |
scene | diagram instance |
- Returns
- true type is allowed
-
false type is not allowed
◆ typeIsAllowedInType()
Check if a listviewitem of type childType is allowed as child of type parentType
◆ typeIsCanvasWidget()
Return true if the listview type also has a widget representation in diagrams.
◆ typeIsClassifier()
Return true if the listview type is a classifier (Class, Entity, Enum)
◆ typeIsClassifierList()
Return true if the listview type is an attribute, operation, or template.
◆ typeIsContainer()
Return true if the listview type may act as a container for other objects, i.e. if it is a folder, package, subsystem, or component.
◆ typeIsDiagram()
Return true if the listview type is a diagram.
◆ typeIsFolder()
Return true if the listview type is a logical, usecase or component folder.
◆ typeIsProperties()
Return true if the listview type is a settings entry.
◆ typeIsRootView()
Return true if the listview type is one of the predefined root views (root, logical, usecase, component, deployment, datatype, or entity- relationship view.)
◆ uniqObjectName()
Returns a name for the new object, appended with a number if the default name is taken e.g. new_actor, new_actor_1 etc.
- Parameters
-
type | The object type. |
parentPkg | The package in which to compare the name. |
prefix | The prefix to use (optional) If no prefix is given then a type related prefix will be chosen internally. |
◆ updateDeleteActionToString()
Converts from the UpdateDeleteAction enum to a QString
- Parameters
-
uda | The UpdateDeleteAction enum literal |