|
void | methodName (const QString &m) |
|
QString | mdlPath () |
|
QString | loc () |
|
QStringList | scan (const QString &lin) |
|
QString | shift (QStringList &l) |
|
bool | checkClosing (QStringList &tokens) |
|
bool | isImmediateValue (QString s) |
|
QString | extractImmediateValues (QStringList &l) |
|
QString | collectVerbatimText (QTextStream &stream) |
|
QString | extractValue (QStringList &l, QTextStream &stream) |
|
PetalNode * | readAttributes (QStringList initialArgs, QTextStream &stream) |
|
UMLPackage * | loadFromMDL (QFile &file, UMLPackage *parentPkg) |
|
QString | clean (const QString &s) |
|
Uml::ID::Type | quid (const PetalNode *node) |
|
QString | quidu (const PetalNode *node) |
|
QPointF | fetchLocation (const PetalNode *node, qreal width, qreal height) |
|
qreal | fetchDouble (const PetalNode *node, const QString &attribute, bool applyRose2Qt=true) |
|
qreal | fetchInt (const PetalNode *node, const QString &attribute, int defaultValue=0) |
|
UMLObject::ObjectType | typeToCreate (const QString &name) |
|
void | transferVisibility (const PetalNode *from, UMLObject *to) |
|
UMLPackage * | handleControlledUnit (PetalNode *node, const QString &name, Uml::ID::Type id, UMLPackage *parentPkg) |
|
void | handleAssocView (PetalNode *attr, const PetalNode::NameValueList &parentAttrs, Uml::AssociationType::Enum assocType, UMLView *view, UMLObject *umlAssoc=nullptr) |
|
Uml::DiagramType::Enum | diagramType (QString objType) |
|
bool | umbrellify (PetalNode *node, UMLPackage *parentPkg) |
|
bool | importView (PetalNode *root, UMLPackage *parent, const QString &rootName, const QString &modelsName, const QString &firstNodeName, const QString &presentationsName) |
|
UMLPackage * | petalTree2Uml (PetalNode *root, UMLPackage *parentPkg) |
|
Rose model import
- 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
Traverse the PetalNode tree and create corresponding Umbrello objects for the PetalNodes encountered.
- 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
◆ ViewTagToWidget_Map
◆ checkClosing()
bool Import_Rose::checkClosing |
( |
QStringList & |
tokens | ) |
|
Check for closing of one or more scopes.
◆ clean()
QString Import_Rose::clean |
( |
const QString & |
s | ) |
|
Return the given string without surrounding quotation marks. Also remove a possible prefix "Logical View::", it is not modeled in Umbrello.
◆ collectVerbatimText()
QString Import_Rose::collectVerbatimText |
( |
QTextStream & |
stream | ) |
|
◆ diagramType()
◆ extractImmediateValues()
QString Import_Rose::extractImmediateValues |
( |
QStringList & |
l | ) |
|
Extract immediate values out of `l'. Examples of immediate value lists: number list: (123, 456) string list: ("SomeText" 888) Any enclosing parentheses are removed. All extracted items are also removed from `l'. For the example given above the following is returned: "123 456" or "\"SomeText\" 888"
◆ extractValue()
QString Import_Rose::extractValue |
( |
QStringList & |
l, |
|
|
QTextStream & |
stream |
|
) |
| |
Extract the stripped down value from a (value ...) element. Example: for the input (value Text "This is some text") the following is extracted: "This is some text" Extracted elements and syntactic sugar of the value element are removed from the input list. The stream is passed into this method because it may be necessary to read new lines - in the case of verbatim text. The format of verbatim text in petal files is as follows:
(value Text |This is the first line of verbatim text. |This is another line of verbatim text. ) (The '|' character is supposed to be in the first column of the line) In this case the two lines are extracted without the leading '|'. The line ending '
' of each line is preserved.
◆ fetchDouble()
qreal Import_Rose::fetchDouble |
( |
const PetalNode * |
node, |
|
|
const QString & |
attribute, |
|
|
bool |
applyRose2Qt = true |
|
) |
| |
Extract a double attribute from a petal node.
◆ fetchInt()
qreal Import_Rose::fetchInt |
( |
const PetalNode * |
node, |
|
|
const QString & |
attribute, |
|
|
int |
defaultValue = 0 |
|
) |
| |
Extract an int attribute from a petal node.
◆ fetchLocation()
QPointF Import_Rose::fetchLocation |
( |
const PetalNode * |
node, |
|
|
qreal |
width, |
|
|
qreal |
height |
|
) |
| |
Extract the location attribute from a petal node. The extracted X,Y coordinates will be adjusted by the factor Rose2Qt unless width and/or height are given as 0.
◆ handleAssocView()
◆ handleControlledUnit()
Handle a controlled unit.
- Parameters
-
node | Pointer to the PetalNode which may contain a controlled unit |
name | Name of the current node |
id | QUID of the current node |
parentPkg | Pointer to the current parent UMLPackage or UMLFolder. |
- Returns
- Pointer to UMLFolder created for controlled unit on success; NULL on error.
◆ importView()
bool Import_Rose::importView |
( |
PetalNode * |
root, |
|
|
UMLPackage * |
parent, |
|
|
const QString & |
rootName, |
|
|
const QString & |
modelsName, |
|
|
const QString & |
firstNodeName, |
|
|
const QString & |
presentationsName |
|
) |
| |
Auxiliary function for UseCase/Component/Deployment view import
◆ isImmediateValue()
bool Import_Rose::isImmediateValue |
( |
QString |
s | ) |
|
Immediate values are numbers or quoted strings.
- Returns
- True if the given text is a natural or negative number or a quoted string.
◆ loadFromMDL()
Parse a file into the PetalNode internal tree representation and then create Umbrello objects by traversing the tree.
- Returns
- In case of error: NULL In case of success with non NULL parentPkg: pointer to UMLPackage created for controlled unit In case of success with NULL parentPkg: pointer to root folder of Logical View
◆ loc()
QString Import_Rose::loc |
( |
| ) |
|
Auxiliary function for diagnostics: Return current location.
◆ mdlPath()
QString Import_Rose::mdlPath |
( |
| ) |
|
◆ methodName()
void Import_Rose::methodName |
( |
const QString & |
m | ) |
|
◆ petalTree2Uml()
Auxiliary method for loadFromMDL() loading of controlled unit. Is kept in a separate file to reflect the fact that it is not coupled with the parser (other than by the PetalNode.)
- Parameters
-
root | the root of the tree |
parentPkg | the owning package within which objects are created |
- Returns
- pointer to the newly created UMLPackage on success, NULL on error
◆ quid()
Extract the quid attribute from a petal node and return it as a Uml::ID::Type.
◆ quidu()
QString Import_Rose::quidu |
( |
const PetalNode * |
node | ) |
|
Extract the quidu attribute from a petal node.
◆ readAttributes()
PetalNode * Import_Rose::readAttributes |
( |
QStringList |
initialArgs, |
|
|
QTextStream & |
stream |
|
) |
| |
Read attributes of a node.
- Parameters
-
initialArgs | Tokens on the line of the opening "(" of the node but with leading whitespace and the opening "(" removed. |
stream | The QTextStream from which to read following lines. |
- Returns
- Pointer to the created PetalNode or NULL on error.
◆ scan()
QStringList Import_Rose::scan |
( |
const QString & |
lin | ) |
|
Split a line into lexemes.
◆ shift()
QString Import_Rose::shift |
( |
QStringList & |
l | ) |
|
◆ transferVisibility()
Transfer the Rose attribute "exportControl" to the Umbrello object given.
- Parameters
-
◆ typeToCreate()
Determine the model type corresponding to a name. If the given name consists only of letters, digits, underscores, and scope separators then return ot_Class, else return ot_Datatype.
◆ umbrellify()
◆ dirPrefix
QString Import_Rose::dirPrefix |
Directory prefix of .mdl file is buffered for possibly finding .cat/.sub controlled units (if no path is given at their definition.)
◆ g_methodName
QString Import_Rose::g_methodName |
◆ linum
◆ nClosures
uint Import_Rose::nClosures |
◆ progLang
Set language if encountered in file. The last language encountered wins.
◆ Rose2Qt
const qreal Import_Rose::Rose2Qt = 0.5 |
The Rose diagram coordinate system is roughly twice the scale of Qt. I.e. when going from Rose diagram-object location/width/height to Qt, we need to shrink everything. The exact factor can be configured here.
◆ viewTagToWidget