Commit 81d2f1cd authored by Ralf Habacker's avatar Ralf Habacker
Browse files

Add layout style for component diagrams

parent f2acb72e
......@@ -40,6 +40,12 @@
#include <QTemporaryFile>
#include <QTextStream>
QString dotType(WidgetBase *widget)
{
const QString rawType = widget->baseTypeStr();
return rawType.toLower().remove(QLatin1String("wt_"));
}
/**
* dot specific paint engine
*/
......@@ -326,8 +332,7 @@ bool DotGenerator::createDotFile(UMLScene *scene, const QString &fileName, const
if (usePosition())
params << QString::fromLatin1("pos=\"%1, %2\"").arg(widget->x()+widget->width()/2).arg(widget->y()+widget->height()/2);
const QString rawType = widget->baseTypeStr();
QString type = rawType.toLower().remove(QLatin1String("wt_"));
QString type = dotType(widget);
if (type == QLatin1String("state")) {
StateWidget *w = static_cast<StateWidget *>(widget);
......@@ -382,6 +387,28 @@ bool DotGenerator::createDotFile(UMLScene *scene, const QString &fileName, const
if (!widget->isTextWidget())
out << "\"" << id << "\""
<< " [" << params.join(QLatin1String(",")) << "];\n";
// add associations for child items
foreach(QGraphicsItem *item, widget->childItems()) {
UMLWidget *w2 = dynamic_cast<UMLWidget *>(item);
QString type2 = dotType(w2);
QString id2 = fixID(Uml::ID::toString(w2->localID()));
QStringList params2;
QString vkey = QString(QLatin1String("visual::type::%1::%2")).arg(type).arg(type2);
if (m_edgeParameters.contains(vkey)) {
params2 << m_edgeParameters[vkey];
} else {
uDebug() << "key" << vkey << "not found; skipping association";
continue;
}
vkey = QString(QLatin1String("ranking::type::%1::%2")).arg(type).arg(type2);
if (m_edgeParameters.contains(vkey)) {
params2 << m_edgeParameters[vkey];
} else {
uDebug() << "key" << vkey << "not found";
}
out << "\"" << id << "\" -> \"" << id2 << "\""
<< " [" << params2.join(QLatin1String(",")) << "];\n";
}
}
foreach(AssociationWidget *assoc, scene->associationList()) {
......
[Desktop Entry]
Type=Service
Name=Horizontal Layout
Name[bs]=Horizontalni raspored
Name[ca]=Disposició horitzontal
Name[ca@valencia]=Disposició horitzontal
Name[cs]=Vodorovné rozložení
Name[da]=Vandret layout
Name[de]=Horizontales Layout
Name[el]=Οριζόντια διάταξη
Name[en_GB]=Horizontal Layout
Name[es]=Disposición horizontal
Name[et]=Rõhtne paigutus
Name[fi]=Vaakasuuntainen asettelu
Name[fr]=Disposition horizontale
Name[gl]=Disposición horizontal
Name[hu]=Vízszintes elrendezés
Name[it]=Disposizione orizzontale
Name[kk]=Жатық орналасуы
Name[ko]=수평 레이아웃
Name[lt]=Horizontalus išdėstymas
Name[mr]=आडवी रचना
Name[nb]=Vannrett utforming
Name[nl]=Horizontale indeling
Name[nn]=Vassrett utforming
Name[pa]=ਹਰੀਜੱਟਲ ਲੇਆਉਟ
Name[pl]=Układ poziomy
Name[pt]=Disposição Horizontal
Name[pt_BR]=Layout horizontal
Name[ru]=Горизонтальный шаблон
Name[sk]=Vodorovné rozloženie
Name[sl]=Vodoravna postavitev
Name[sr]=Водоравни распоред
Name[sr@ijekavian]=Водоравни распоред
Name[sr@ijekavianlatin]=Vodoravni raspored
Name[sr@latin]=Vodoravni raspored
Name[sv]=Horisontell layout
Name[tr]=Yatay Düzen
Name[uk]=Горизонтальне компонування
Name[x-test]=xxHorizontal Layoutxx
Name[zh_CN]=水平布局
Name[zh_TW]=水平佈局
Comment=Layout which renders horizontal
Comment[bs]=Raspored koji obrađuje horizontalno
Comment[ca]=Disposició que renderitza horitzontalment
Comment[ca@valencia]=Disposició que renderitza horitzontalment
Comment[da]=Layout som renderes vandret
Comment[de]=Layout, das horizontal gerendert wird
Comment[el]=Διάταξη που αποτυπώνεται οριζόντια
Comment[en_GB]=Layout which renders Horizontal
Comment[es]=Diseño que se organiza de forma horizontal
Comment[et]=Rõhtsalt renderdatud paigutus
Comment[fi]=Vaakasuuntaan piirtävä asettelu
Comment[fr]=Disposition permettant un rendu horizontal
Comment[gl]=Disposición que renderiza de maneira horizontal.
Comment[hu]=Elrendezés, amely vízszintesen jelenít meg
Comment[it]=Disposizione che rende in orizzontale
Comment[kk]=Қатарлап орналасуы
Comment[ko]=수평으로 표시되는 레이아웃
Comment[nb]=Utforming som tegner opp vannrett
Comment[nl]=Indeling die zich horizontaal laat weergeven
Comment[nn]=Utforming vist vassrett
Comment[pl]=Układ, który wyświetla poziomo
Comment[pt]=Uma disposição que representa os itens na horizontal
Comment[pt_BR]=Layout que representa os itens na horizontal
Comment[ru]=Шаблон с расположением по горизонтали
Comment[sk]=Rozloženie, ktoré renderuje vodorovne
Comment[sl]=Postavitev, ki se izriše vodoravno
Comment[sr]=Распоред који исцртава водоравно
Comment[sr@ijekavian]=Распоред који исцртава водоравно
Comment[sr@ijekavianlatin]=Raspored koji iscrtava vodoravno
Comment[sr@latin]=Raspored koji iscrtava vodoravno
Comment[sv]=Layout som återger horisontellt
Comment[tr]=Yatay hazırlanan düzen
Comment[uk]=Компонування з горизонтальним розташуванням елементів
Comment[x-test]=xxLayout which renders horizontalxx
Comment[zh_CN]=水平显示的布局
Comment[zh_TW]=水平繪製的佈局
[X-UMBRELLO-Dot-Nodes]
type::artifact=shape=box
type::component=shape=component
type::interface=shape=doublecircle
type::note=shape=box
type::default=shape=box
# for dot output
[X-UMBRELLO-Dot-Edges]
# for visual representation
visual::type::component::port=arrowhead=none,style=invis
visual::type::anchor=arrowhead=none,style=dashed
visual::type::association=arrowhead=none
visual::type::dependency=arrowtail=vee,style=dashed,dir=back
visual::type::realization=arrowtail=normal,dir=back
visual::type::uniassociation=arrowtail=vee,dir=back
visual::type::default=arrowhead=none
# for position ranking
ranking::type::component::port=minlen=0.0001,constraint=false
#ranking::type::anchor=weight=0.001
#ranking::type::association=weight=0.5
ranking::type::dependency=weight=0.8
#ranking::type::realization=weight=0.8
#ranking::type::uniassociation=weight=0.5
ranking::type::default=weight=0.001
[X-UMBRELLO-Dot-Attributes]
graph=splines=polyline,rankdir=TB,outputorder=nodesfirst,ranksep=0.5,nodesep=0.5
node=
edge=
[X-UMBRELLO-Dot-Settings]
origin=50,50
[Desktop Entry]
Type=Service
Name=Vertical Layout
Name[bs]=Vertikalni raspored
Name[ca]=Disposició vertical
Name[ca@valencia]=Disposició vertical
Name[cs]=Svislé rozvržení
Name[da]=Lodret layout
Name[de]=Vertikales Layout
Name[el]=Κατακόρυφη διάταξη
Name[en_GB]=Vertical Layout
Name[es]=Disposición vertical
Name[et]=Püstine paigutus
Name[fi]=Pystysuuntainen asettelu
Name[fr]=Disposition verticale
Name[gl]=Disposición vertical
Name[hu]=Függőleges elrendezés
Name[it]=Disposizione verticale
Name[kk]=Тік орналасуы
Name[ko]=수직 레이아웃
Name[lt]=Vertikalus išdėstymas
Name[mr]=उभी रचना
Name[nb]=Loddrett utforming
Name[nl]=Verticale indeling
Name[pa]=ਵਰਟੀਕਲ ਲੇਆਉਟ
Name[pl]=Układ pionowy
Name[pt]=Disposição Vertical
Name[pt_BR]=Layout vertical
Name[ru]=Вертикальный шаблон
Name[sk]=Zvislé rozloženie
Name[sl]=Navpična postavitev
Name[sr]=Усправни распоред
Name[sr@ijekavian]=Усправни распоред
Name[sr@ijekavianlatin]=Uspravni raspored
Name[sr@latin]=Uspravni raspored
Name[sv]=Vertikal layout
Name[tr]=Dikey Düzen
Name[uk]=Вертикальне компонування
Name[x-test]=xxVertical Layoutxx
Name[zh_CN]=垂直布局
Name[zh_TW]=垂直佈局
Comment=Layout which renders vertical
Comment[bs]=Raspored koji obrađuej vertikalno
Comment[ca]=Disposició que renderitza verticalment
Comment[ca@valencia]=Disposició que renderitza verticalment
Comment[da]=Layout som renderer lodret
Comment[de]=Layout, das vertikal gerendert wird
Comment[el]=Διάταξη που αποτυπώνεται κάθετα
Comment[en_GB]=Layout which renders vertical
Comment[es]=Diseño que se organiza de forma vertical
Comment[et]=Püstiselt renderdatud paigutus
Comment[fi]=Pystysuuntaan piirtävä asettelu
Comment[fr]=Disposition permettant un rendu vertical
Comment[gl]=Disposición que renderiza de maneira vertical.
Comment[hu]=Elrendezés, amely függőlegesen jelenít meg
Comment[it]=Disposizione che rende in verticale
Comment[kk]=Бір үстінен бір орналасуы
Comment[ko]=수직으로 표시되는 레이아웃
Comment[nb]=Utforming som tegner opp loddrett
Comment[nl]=Indeling die zich verticaal laat weergeven
Comment[pl]=Układ, który wyświetla pionowo
Comment[pt]=Uma disposição que representa os itens na vertical
Comment[pt_BR]=Layout que representa os itens na vertical
Comment[ru]=Шаблон с расположением по вертикали
Comment[sk]=Rozloženie, ktoré renderuje zvislo
Comment[sl]=Postavitev, ki se izriše navpično
Comment[sr]=Распоред који исцртава усправно
Comment[sr@ijekavian]=Распоред који исцртава усправно
Comment[sr@ijekavianlatin]=Raspored koji iscrtava uspravno
Comment[sr@latin]=Raspored koji iscrtava uspravno
Comment[sv]=Layout som återger vertikalt
Comment[tr]=Dikey hazırlanan düzen
Comment[uk]=Компонування з вертикальним розташуванням елементів
Comment[x-test]=xxLayout which renders verticalxx
Comment[zh_CN]=垂直显示的布局
Comment[zh_TW]=垂直繪製的佈局
[X-UMBRELLO-Dot-Nodes]
type::artifact=shape=box
type::component=shape=component
type::interface=shape=doublecircle
type::note=shape=box
type::default=shape=box
# for dot output
[X-UMBRELLO-Dot-Edges]
# for visual representation
visual::type::component::port=arrowhead=none,style=invis
visual::type::anchor=arrowhead=none,style=dashed
visual::type::association=arrowhead=none
visual::type::dependency=arrowtail=vee,style=dashed,dir=back
visual::type::realization=arrowtail=normal,dir=back
visual::type::uniassociation=arrowtail=vee,dir=back
visual::type::default=arrowhead=none
# for position ranking
ranking::type::component::port=minlen=0.0001
#ranking::type::anchor=weight=0.001
#ranking::type::association=weight=0.5
ranking::type::dependency=weight=0.8
#ranking::type::realization=weight=0.8
#ranking::type::uniassociation=weight=0.5
ranking::type::default=weight=0.001
[X-UMBRELLO-Dot-Attributes]
graph=splines=polyline,rankdir=TB,outputorder=nodesfirst,ranksep=0.5,nodesep=0.5
node=
edge=
[X-UMBRELLO-Dot-Settings]
origin=50,50
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment