1.1 --- a/branchobj.cpp Mon Apr 18 06:37:48 2005 +0000
1.2 +++ b/branchobj.cpp Thu Apr 21 19:14:38 2005 +0000
1.3 @@ -828,6 +828,11 @@
1.4 if (!xlo->isUsed()) delete(xlo);
1.5 }
1.6
1.7 +XLinkObj* BranchObj::XLinkAt (int i)
1.8 +{
1.9 + return xlink.at(i);
1.10 +}
1.11 +
1.12 int BranchObj::countXLink()
1.13 {
1.14 return xlink.count();
2.1 --- a/branchobj.h Mon Apr 18 06:37:48 2005 +0000
2.2 +++ b/branchobj.h Thu Apr 21 19:14:38 2005 +0000
2.3 @@ -67,6 +67,7 @@
2.4 virtual void removeXLinkRef (XLinkObj*); // Remove ref in list
2.5 virtual void deleteXLink (XLinkObj*); // remove references and delete XLinkObj
2.6 virtual void deleteXLinkAt (int); // remove references and delete XLinkObj
2.7 + virtual XLinkObj* XLinkAt (int); // return reference of XLinkObj
2.8 virtual int countXLink ();
2.9 virtual BranchObj* XLinkTargetAt (int);
2.10 virtual LinkableMapObj* addFloatImage();
3.1 --- a/editxlinkdialog.ui Mon Apr 18 06:37:48 2005 +0000
3.2 +++ b/editxlinkdialog.ui Thu Apr 21 19:14:38 2005 +0000
3.3 @@ -8,59 +8,224 @@
3.4 <rect>
3.5 <x>0</x>
3.6 <y>0</y>
3.7 - <width>570</width>
3.8 - <height>91</height>
3.9 + <width>607</width>
3.10 + <height>206</height>
3.11 </rect>
3.12 </property>
3.13 + <property name="sizePolicy">
3.14 + <sizepolicy>
3.15 + <hsizetype>5</hsizetype>
3.16 + <vsizetype>5</vsizetype>
3.17 + <horstretch>0</horstretch>
3.18 + <verstretch>0</verstretch>
3.19 + </sizepolicy>
3.20 + </property>
3.21 <property name="caption">
3.22 - <string>Edit Link</string>
3.23 + <string>Edit XLink</string>
3.24 </property>
3.25 - <grid>
3.26 + <vbox>
3.27 <property name="name">
3.28 <cstring>unnamed</cstring>
3.29 </property>
3.30 - <widget class="QPushButton" row="0" column="0">
3.31 + <widget class="QLayoutWidget">
3.32 <property name="name">
3.33 - <cstring>deleteButton</cstring>
3.34 + <cstring>layout5</cstring>
3.35 </property>
3.36 - <property name="text">
3.37 - <string>Delete XLink</string>
3.38 - </property>
3.39 + <grid>
3.40 + <property name="name">
3.41 + <cstring>unnamed</cstring>
3.42 + </property>
3.43 + <spacer row="0" column="2" rowspan="1" colspan="2">
3.44 + <property name="name">
3.45 + <cstring>spacer2</cstring>
3.46 + </property>
3.47 + <property name="orientation">
3.48 + <enum>Horizontal</enum>
3.49 + </property>
3.50 + <property name="sizeType">
3.51 + <enum>Expanding</enum>
3.52 + </property>
3.53 + <property name="sizeHint">
3.54 + <size>
3.55 + <width>462</width>
3.56 + <height>20</height>
3.57 + </size>
3.58 + </property>
3.59 + </spacer>
3.60 + <widget class="QLabel" row="0" column="0">
3.61 + <property name="name">
3.62 + <cstring>textLabel1</cstring>
3.63 + </property>
3.64 + <property name="text">
3.65 + <string>Line width:</string>
3.66 + </property>
3.67 + <property name="alignment">
3.68 + <set>AlignVCenter|AlignRight</set>
3.69 + </property>
3.70 + </widget>
3.71 + <spacer row="1" column="2" rowspan="1" colspan="2">
3.72 + <property name="name">
3.73 + <cstring>spacer3</cstring>
3.74 + </property>
3.75 + <property name="orientation">
3.76 + <enum>Horizontal</enum>
3.77 + </property>
3.78 + <property name="sizeType">
3.79 + <enum>Expanding</enum>
3.80 + </property>
3.81 + <property name="sizeHint">
3.82 + <size>
3.83 + <width>463</width>
3.84 + <height>21</height>
3.85 + </size>
3.86 + </property>
3.87 + </spacer>
3.88 + <widget class="QCheckBox" row="2" column="1" rowspan="1" colspan="2">
3.89 + <property name="name">
3.90 + <cstring>useSettings</cstring>
3.91 + </property>
3.92 + <property name="text">
3.93 + <string>(use settings as default for new xlinks)</string>
3.94 + </property>
3.95 + </widget>
3.96 + <widget class="QPushButton" row="1" column="1">
3.97 + <property name="name">
3.98 + <cstring>colorButton</cstring>
3.99 + </property>
3.100 + <property name="enabled">
3.101 + <bool>true</bool>
3.102 + </property>
3.103 + <property name="maximumSize">
3.104 + <size>
3.105 + <width>50</width>
3.106 + <height>20</height>
3.107 + </size>
3.108 + </property>
3.109 + <property name="text">
3.110 + <string></string>
3.111 + </property>
3.112 + </widget>
3.113 + <widget class="QSpinBox" row="0" column="1">
3.114 + <property name="name">
3.115 + <cstring>widthBox</cstring>
3.116 + </property>
3.117 + <property name="sizePolicy">
3.118 + <sizepolicy>
3.119 + <hsizetype>0</hsizetype>
3.120 + <vsizetype>0</vsizetype>
3.121 + <horstretch>0</horstretch>
3.122 + <verstretch>0</verstretch>
3.123 + </sizepolicy>
3.124 + </property>
3.125 + <property name="maxValue">
3.126 + <number>15</number>
3.127 + </property>
3.128 + <property name="minValue">
3.129 + <number>1</number>
3.130 + </property>
3.131 + </widget>
3.132 + <widget class="QLabel" row="1" column="0">
3.133 + <property name="name">
3.134 + <cstring>textLabel2</cstring>
3.135 + </property>
3.136 + <property name="text">
3.137 + <string>Line color:</string>
3.138 + </property>
3.139 + <property name="alignment">
3.140 + <set>AlignVCenter|AlignRight</set>
3.141 + </property>
3.142 + </widget>
3.143 + <widget class="QLabel" row="2" column="0">
3.144 + <property name="name">
3.145 + <cstring>textLabel1_2</cstring>
3.146 + </property>
3.147 + <property name="text">
3.148 + <string>Default:</string>
3.149 + </property>
3.150 + <property name="alignment">
3.151 + <set>AlignVCenter|AlignRight</set>
3.152 + </property>
3.153 + </widget>
3.154 + <spacer row="2" column="3">
3.155 + <property name="name">
3.156 + <cstring>spacer5</cstring>
3.157 + </property>
3.158 + <property name="orientation">
3.159 + <enum>Horizontal</enum>
3.160 + </property>
3.161 + <property name="sizeType">
3.162 + <enum>Expanding</enum>
3.163 + </property>
3.164 + <property name="sizeHint">
3.165 + <size>
3.166 + <width>110</width>
3.167 + <height>21</height>
3.168 + </size>
3.169 + </property>
3.170 + </spacer>
3.171 + </grid>
3.172 </widget>
3.173 - <spacer row="0" column="1">
3.174 + <spacer>
3.175 <property name="name">
3.176 - <cstring>spacer11</cstring>
3.177 + <cstring>spacer4</cstring>
3.178 </property>
3.179 <property name="orientation">
3.180 - <enum>Horizontal</enum>
3.181 + <enum>Vertical</enum>
3.182 </property>
3.183 <property name="sizeType">
3.184 <enum>Expanding</enum>
3.185 </property>
3.186 <property name="sizeHint">
3.187 <size>
3.188 - <width>180</width>
3.189 - <height>20</height>
3.190 + <width>20</width>
3.191 + <height>40</height>
3.192 </size>
3.193 </property>
3.194 </spacer>
3.195 - <widget class="QPushButton" row="0" column="3">
3.196 + <widget class="QLayoutWidget">
3.197 <property name="name">
3.198 - <cstring>okButton</cstring>
3.199 + <cstring>layout4</cstring>
3.200 </property>
3.201 - <property name="text">
3.202 - <string>Ok</string>
3.203 - </property>
3.204 + <hbox>
3.205 + <property name="name">
3.206 + <cstring>unnamed</cstring>
3.207 + </property>
3.208 + <widget class="QPushButton">
3.209 + <property name="name">
3.210 + <cstring>deleteButton</cstring>
3.211 + </property>
3.212 + <property name="text">
3.213 + <string>Delete XLink</string>
3.214 + </property>
3.215 + </widget>
3.216 + <spacer>
3.217 + <property name="name">
3.218 + <cstring>spacer11</cstring>
3.219 + </property>
3.220 + <property name="orientation">
3.221 + <enum>Horizontal</enum>
3.222 + </property>
3.223 + <property name="sizeType">
3.224 + <enum>Expanding</enum>
3.225 + </property>
3.226 + <property name="sizeHint">
3.227 + <size>
3.228 + <width>100</width>
3.229 + <height>20</height>
3.230 + </size>
3.231 + </property>
3.232 + </spacer>
3.233 + <widget class="QPushButton">
3.234 + <property name="name">
3.235 + <cstring>okButton</cstring>
3.236 + </property>
3.237 + <property name="text">
3.238 + <string>Ok</string>
3.239 + </property>
3.240 + </widget>
3.241 + </hbox>
3.242 </widget>
3.243 - <widget class="QPushButton" row="0" column="2">
3.244 - <property name="name">
3.245 - <cstring>cancelButton</cstring>
3.246 - </property>
3.247 - <property name="text">
3.248 - <string>Cancel</string>
3.249 - </property>
3.250 - </widget>
3.251 - </grid>
3.252 + </vbox>
3.253 </widget>
3.254 <connections>
3.255 <connection>
3.256 @@ -70,30 +235,43 @@
3.257 <slot>accept()</slot>
3.258 </connection>
3.259 <connection>
3.260 - <sender>cancelButton</sender>
3.261 - <signal>clicked()</signal>
3.262 - <receiver>EditXLinkDialog</receiver>
3.263 - <slot>reject()</slot>
3.264 - </connection>
3.265 - <connection>
3.266 <sender>deleteButton</sender>
3.267 <signal>clicked()</signal>
3.268 <receiver>EditXLinkDialog</receiver>
3.269 <slot>deleteButtonPressed()</slot>
3.270 </connection>
3.271 + <connection>
3.272 + <sender>colorButton</sender>
3.273 + <signal>clicked()</signal>
3.274 + <receiver>EditXLinkDialog</receiver>
3.275 + <slot>colorButtonPressed()</slot>
3.276 + </connection>
3.277 + <connection>
3.278 + <sender>widthBox</sender>
3.279 + <signal>valueChanged(int)</signal>
3.280 + <receiver>EditXLinkDialog</receiver>
3.281 + <slot>widthChanged(int)</slot>
3.282 + </connection>
3.283 </connections>
3.284 <includes>
3.285 + <include location="global" impldecl="in implementation">qcolordialog.h</include>
3.286 + <include location="local" impldecl="in declaration">xlinkobj.h</include>
3.287 <include location="local" impldecl="in implementation">editxlinkdialog.ui.h</include>
3.288 </includes>
3.289 <variables>
3.290 <variable access="private">bool delink;</variable>
3.291 + <variable access="private">XLinkObj *xlo;</variable>
3.292 </variables>
3.293 <slots>
3.294 <slot access="protected">deleteButtonPressed()</slot>
3.295 + <slot access="protected">widthChanged( int w )</slot>
3.296 + <slot>setXLink( XLinkObj * xo )</slot>
3.297 + <slot access="protected">colorButtonPressed()</slot>
3.298 </slots>
3.299 <functions>
3.300 <function access="private" specifier="non virtual">init()</function>
3.301 <function returnType="bool">deleteXLink()</function>
3.302 + <function returnType="bool">useSettingsGlobal()</function>
3.303 </functions>
3.304 <pixmapinproject/>
3.305 <layoutdefaults spacing="6" margin="11"/>
4.1 --- a/editxlinkdialog.ui.h Mon Apr 18 06:37:48 2005 +0000
4.2 +++ b/editxlinkdialog.ui.h Thu Apr 21 19:14:38 2005 +0000
4.3 @@ -9,6 +9,7 @@
4.4 void EditXLinkDialog::init()
4.5 {
4.6 delink=false;
4.7 + xlo=false;
4.8 }
4.9
4.10 void EditXLinkDialog::deleteButtonPressed()
4.11 @@ -21,3 +22,32 @@
4.12 {
4.13 return delink;
4.14 }
4.15 +
4.16 +
4.17 +void EditXLinkDialog::widthChanged( int w)
4.18 +{
4.19 + xlo->setWidth(w);
4.20 +}
4.21 +
4.22 +void EditXLinkDialog::setXLink( XLinkObj * xo)
4.23 +{
4.24 + xlo=xo;
4.25 + colorButton->setPaletteBackgroundColor (xlo->getColor() );
4.26 + widthBox->setValue(xlo->getWidth());
4.27 +}
4.28 +
4.29 +void EditXLinkDialog::colorButtonPressed()
4.30 +{
4.31 + if (xlo)
4.32 + {
4.33 + QColor col = QColorDialog::getColor(xlo->getColor(), this );
4.34 + if ( !col.isValid() ) return;
4.35 + xlo->setColor( col );
4.36 + colorButton->setPaletteBackgroundColor (col);
4.37 + }
4.38 +}
4.39 +
4.40 +bool EditXLinkDialog::useSettingsGlobal ()
4.41 +{
4.42 + return useSettings->isChecked();
4.43 +}
5.1 --- a/linkablemapobj.cpp Mon Apr 18 06:37:48 2005 +0000
5.2 +++ b/linkablemapobj.cpp Thu Apr 21 19:14:38 2005 +0000
5.3 @@ -441,14 +441,6 @@
5.4 childPos=QPoint (absPos.x()+ bbox.width(), absPos.y() + offset );
5.5 parPos=QPoint (absPos.x(),absPos.y()+offset);
5.6 }
5.7 - /* FIXME
5.8 - cout << " LMO::updateLink absPos="<<absPos<<endl;
5.9 - cout << " LMO::updateLink childPos="<<childPos<<endl;
5.10 - cout << " LMO::updateLink parPos="<<parPos<<endl;
5.11 - cout << " LMO::updateLink offset="<<offset<<endl;
5.12 - cout << " LMO::updateLink bbox.w="<<bbox.width()<<endl;
5.13 - cout << " LMO::updateLink bbox.h="<<bbox.height()<<endl;
5.14 - */
5.15
5.16 double p1x=parPos.x(); // Link is drawn from P1 to P2
5.17 double p1y=parPos.y();
6.1 --- a/mapeditor.cpp Mon Apr 18 06:37:48 2005 +0000
6.2 +++ b/mapeditor.cpp Thu Apr 21 19:14:38 2005 +0000
6.3 @@ -283,7 +283,8 @@
6.4 lineedit->hide();
6.5
6.6 actColor=black; setColor (actColor);
6.7 - deflinkcolor=QColor (0,0,255);
6.8 + defLinkColor=QColor (0,0,255);
6.9 + defXLinkColor=QColor (180,180,180);
6.10 linkcolorhint=DefaultColor;
6.11 linkstyle=StylePolyParabel;
6.12 mapCanvas->setBackgroundColor (white);
6.13 @@ -506,7 +507,9 @@
6.14 attribut("date",mapCenter->getDate()) +
6.15 attribut("backgroundColor", mapCanvas->backgroundColor().name() ) +
6.16 attribut("linkStyle", ls ) +
6.17 - attribut("linkColor", deflinkcolor.name() ) +
6.18 + attribut("linkColor", defLinkColor.name() ) +
6.19 + attribut("xlinkColor", defXLinkColor.name() ) +
6.20 + attribut("xlinkWidth", QString().setNum(defXLinkWidth,10) ) +
6.21 colhint;
6.22 s+=beginElement("vymmap",mapAttr);
6.23 incIndent();
6.24 @@ -2193,7 +2196,7 @@
6.25 QPixmap pix( 16, 16 );
6.26 pix.fill( mapCanvas->backgroundColor() );
6.27 actionFormatBackColor->setIconSet( pix );
6.28 - pix.fill( deflinkcolor );
6.29 + pix.fill( defLinkColor );
6.30 actionFormatLinkColor->setIconSet( pix );
6.31
6.32 actionEditUndo->setEnabled( mapChanged );
6.33 @@ -2377,7 +2380,7 @@
6.34
6.35 void MapEditor::setLinkColor(QColor c)
6.36 {
6.37 - deflinkcolor=c;
6.38 + defLinkColor=c;
6.39 updateActions();
6.40 }
6.41
6.42 @@ -2421,7 +2424,27 @@
6.43
6.44 QColor MapEditor::getDefLinkColor()
6.45 {
6.46 - return deflinkcolor;
6.47 + return defLinkColor;
6.48 +}
6.49 +
6.50 +void MapEditor::setDefXLinkColor(QColor col)
6.51 +{
6.52 + defXLinkColor=col;
6.53 +}
6.54 +
6.55 +QColor MapEditor::getDefXLinkColor()
6.56 +{
6.57 + return defXLinkColor;
6.58 +}
6.59 +
6.60 +void MapEditor::setDefXLinkWidth (int w)
6.61 +{
6.62 + defXLinkWidth=w;
6.63 +}
6.64 +
6.65 +int MapEditor::getDefXLinkWidth()
6.66 +{
6.67 + return defXLinkWidth;
6.68 }
6.69
6.70 void MapEditor::selectLinkColor()
6.71 @@ -2429,7 +2452,7 @@
6.72 // Finish open lineEdits
6.73 if (lineedit) finishedLineEditNoSave();
6.74
6.75 - QColor col = QColorDialog::getColor( deflinkcolor, this );
6.76 + QColor col = QColorDialog::getColor( defLinkColor, this );
6.77 if ( !col.isValid() ) return;
6.78 setLinkColor( col );
6.79 setChanged();
6.80 @@ -2649,29 +2672,45 @@
6.81
6.82 void MapEditor::followXLink(int i)
6.83 {
6.84 - BranchObj *bo=((BranchObj*)(selection))->XLinkTargetAt(i);
6.85 - if (bo)
6.86 + if (selection &&
6.87 + (typeid(*selection) == typeid(BranchObj)) ||
6.88 + (typeid(*selection) == typeid(MapCenterObj)) )
6.89 {
6.90 - selection->unselect();
6.91 - selection=bo;
6.92 - selection->select();
6.93 - ensureSelectionVisible();
6.94 + BranchObj *bo=((BranchObj*)(selection))->XLinkTargetAt(i);
6.95 + if (bo)
6.96 + {
6.97 + selection->unselect();
6.98 + selection=bo;
6.99 + selection->select();
6.100 + ensureSelectionVisible();
6.101 + }
6.102 }
6.103 }
6.104
6.105 void MapEditor::editXLink(int i)
6.106 {
6.107 - BranchObj *bo=((BranchObj*)(selection))->XLinkTargetAt(i);
6.108 - if (bo)
6.109 + if (selection &&
6.110 + (typeid(*selection) == typeid(BranchObj)) ||
6.111 + (typeid(*selection) == typeid(MapCenterObj)) )
6.112 {
6.113 - EditXLinkDialog dia;
6.114 - if (dia.exec() == QDialog::Accepted)
6.115 + XLinkObj *xlo=((BranchObj*)(selection))->XLinkAt(i);
6.116 + if (xlo)
6.117 {
6.118 - if (dia.deleteXLink())
6.119 - ((BranchObj*)(selection))->deleteXLinkAt(i);
6.120 - setChanged();
6.121 - }
6.122 - }
6.123 + EditXLinkDialog dia;
6.124 + dia.setXLink (xlo);
6.125 + if (dia.exec() == QDialog::Accepted)
6.126 + {
6.127 + if (dia.useSettingsGlobal() )
6.128 + {
6.129 + setDefXLinkColor (xlo->getColor() );
6.130 + setDefXLinkWidth (xlo->getWidth() );
6.131 + }
6.132 + if (dia.deleteXLink())
6.133 + ((BranchObj*)(selection))->deleteXLinkAt(i);
6.134 + setChanged();
6.135 + }
6.136 + }
6.137 + }
6.138 }
6.139
6.140 void MapEditor::testFunction()
6.141 @@ -2784,6 +2823,8 @@
6.142 tmpXLink=new XLinkObj (mapCanvas);
6.143 tmpXLink->setBegin (bo_begin);
6.144 tmpXLink->setEnd (p);
6.145 + tmpXLink->setColor(defXLinkColor);
6.146 + tmpXLink->setWidth(defXLinkWidth);
6.147 tmpXLink->updateXLink();
6.148 tmpXLink->setVisibility (true);
6.149 return;
7.1 --- a/mapeditor.h Mon Apr 18 06:37:48 2005 +0000
7.2 +++ b/mapeditor.h Thu Apr 21 19:14:38 2005 +0000
7.3 @@ -115,6 +115,10 @@
7.4 void setLinkColorHint(LinkColorHint); // color of links
7.5 LinkColorHint getLinkColorHint();
7.6 QColor getDefLinkColor();
7.7 + void setDefXLinkColor(QColor);
7.8 + QColor getDefXLinkColor();
7.9 + void setDefXLinkWidth (int);
7.10 + int getDefXLinkWidth();
7.11 void toggleLinkColorHint(); // after changing linkStyles
7.12 void selectLinkColor();
7.13 void toggleScroll();
7.14 @@ -149,7 +153,9 @@
7.15 QLineEdit* lineedit;
7.16
7.17 QColor actColor; // actual color
7.18 - QColor deflinkcolor; // default color for links
7.19 + QColor defLinkColor; // default color for links
7.20 + QColor defXLinkColor; // default color for xlinks
7.21 + int defXLinkWidth; // default width for xlinks
7.22 LinkColorHint linkcolorhint;// use heading color or own color
7.23 LinkStyle linkstyle; // default style for links
7.24
8.1 --- a/misc.h Mon Apr 18 06:37:48 2005 +0000
8.2 +++ b/misc.h Thu Apr 21 19:14:38 2005 +0000
8.3 @@ -7,6 +7,7 @@
8.4 using namespace std;
8.5
8.6 #define Z_BBOX 0
8.7 +#define Z_XLINK 10
8.8 #define Z_LINK 20
8.9 #define Z_FRAME 50
8.10 #define Z_SELBOX 60
9.1 --- a/version.h Mon Apr 18 06:37:48 2005 +0000
9.2 +++ b/version.h Thu Apr 21 19:14:38 2005 +0000
9.3 @@ -2,6 +2,6 @@
9.4 #define VERSION_H
9.5
9.6 #define __VYM_VERSION__ "1.6.4"
9.7 -#define __BUILD_DATE__ "April 15, 2005"
9.8 +#define __BUILD_DATE__ "April 21, 2005"
9.9
9.10 #endif
10.1 --- a/vym.pro Mon Apr 18 06:37:48 2005 +0000
10.2 +++ b/vym.pro Thu Apr 21 19:14:38 2005 +0000
10.3 @@ -1,3 +1,8 @@
10.4 +
10.5 +
10.6 +
10.7 +
10.8 +
10.9 TARGET = vym
10.10 TRANSLATIONS += lang/vym_de.ts
10.11 TRANSLATIONS += lang/vym_en.ts
10.12 @@ -22,6 +27,42 @@
10.13 INSTALLS += demo
10.14
10.15
10.16 +
10.17 +
10.18 +
10.19 +
10.20 +
10.21 +
10.22 +
10.23 +
10.24 +
10.25 +
10.26 +
10.27 +
10.28 +
10.29 +
10.30 +
10.31 +
10.32 +
10.33 +
10.34 +
10.35 +
10.36 +
10.37 +
10.38 +
10.39 +
10.40 +
10.41 +
10.42 +
10.43 +
10.44 +
10.45 +
10.46 +
10.47 +
10.48 +
10.49 +
10.50 +
10.51 +
10.52 TEMPLATE = app
10.53 LANGUAGE = C++
10.54
11.1 --- a/xlinkobj.cpp Mon Apr 18 06:37:48 2005 +0000
11.2 +++ b/xlinkobj.cpp Thu Apr 21 19:14:38 2005 +0000
11.3 @@ -1,5 +1,6 @@
11.4 #include "xlinkobj.h"
11.5 #include "branchobj.h"
11.6 +#include "mapeditor.h"
11.7
11.8
11.9 /////////////////////////////////////////////////////////////////
11.10 @@ -7,7 +8,6 @@
11.11 /////////////////////////////////////////////////////////////////
11.12
11.13 int XLinkObj::arrowSize=10; // make instances
11.14 -QColor XLinkObj::defXLinkColor=QColor(180,180,180);
11.15
11.16 XLinkObj::XLinkObj ():MapObj()
11.17 {
11.18 @@ -38,13 +38,16 @@
11.19 visBranch=NULL;
11.20 xLinkState=undefinedXLink;
11.21
11.22 - xLinkColor=defXLinkColor;
11.23 + width=1;
11.24 + color=QColor (180,180,180);
11.25 line=new QCanvasLine (canvas);
11.26 line->setPoints (0,0,200,200);
11.27 - line->setPen (QPen(xLinkColor, 1));
11.28 + line->setPen (QPen(color, 1));
11.29 + line->setZ (Z_XLINK);
11.30
11.31 poly=new QCanvasPolygon (canvas);
11.32 - poly->setBrush( xLinkColor );
11.33 + poly->setBrush( color );
11.34 + poly->setZ (Z_XLINK);
11.35
11.36 setVisibility (false);
11.37 }
11.38 @@ -79,9 +82,27 @@
11.39 }
11.40 }
11.41
11.42 +void XLinkObj::setWidth (int w)
11.43 +{
11.44 + width=w;
11.45 + setColor (color);
11.46 +}
11.47 +
11.48 +int XLinkObj::getWidth()
11.49 +{
11.50 + return width;
11.51 +}
11.52 +
11.53 void XLinkObj::setColor(QColor c)
11.54 {
11.55 - xLinkColor=c;
11.56 + color=c;
11.57 + line->setPen (QPen(color, width));
11.58 + poly->setBrush( color );
11.59 +}
11.60 +
11.61 +QColor XLinkObj::getColor()
11.62 +{
11.63 + return color;
11.64 }
11.65
11.66 void XLinkObj::setEnd (QPoint p)
11.67 @@ -249,10 +270,11 @@
11.68 QString s;
11.69 if (beginBranch && endBranch)
11.70 {
11.71 - QString colAttr=attribut ("color",xLinkColor.name());
11.72 + QString colAttr=attribut ("color",color.name());
11.73 + QString widAttr=attribut ("width",QString().setNum(width,10));
11.74 QString begSelAttr=attribut ("beginBranch",beginBranch->getSelectString());
11.75 QString endSelAttr=attribut ("endBranch", endBranch->getSelectString());
11.76 - s=beginElement ("xlink", colAttr +begSelAttr +endSelAttr);
11.77 + s=beginElement ("xlink", colAttr +widAttr +begSelAttr +endSelAttr);
11.78
11.79 s+=endElement ("xlink");
11.80 }
12.1 --- a/xlinkobj.h Mon Apr 18 06:37:48 2005 +0000
12.2 +++ b/xlinkobj.h Thu Apr 21 19:14:38 2005 +0000
12.3 @@ -17,6 +17,9 @@
12.4 void setEnd (BranchObj*);
12.5 void setEnd (QPoint);
12.6 void setColor(QColor);
12.7 + QColor getColor();
12.8 + void setWidth (int);
12.9 + int getWidth ();
12.10 bool activate (); // Sets pointers in branchObjects
12.11 void deactivate(); // removes those pointers
12.12 bool isUsed(); // true, if at least on branch uses it
12.13 @@ -30,8 +33,8 @@
12.14
12.15 private:
12.16 static int arrowSize;
12.17 - static QColor defXLinkColor;
12.18 - QColor xLinkColor;
12.19 + QColor color;
12.20 + int width;
12.21 QCanvasLine *line;
12.22 QCanvasPolygon *poly;
12.23 BranchObj *beginBranch;
13.1 --- a/xml.cpp Mon Apr 18 06:37:48 2005 +0000
13.2 +++ b/xml.cpp Thu Apr 21 19:14:38 2005 +0000
13.3 @@ -106,6 +106,15 @@
13.4 col.setNamedColor(atts.value("linkColor"));
13.5 me->setLinkColor(col);
13.6 }
13.7 + if (!atts.value( "xlinkColor").isEmpty() )
13.8 + {
13.9 + col.setNamedColor(atts.value("xlinkColor"));
13.10 + me->setDefXLinkColor(col);
13.11 + }
13.12 + if (!atts.value( "xlinkWidth").isEmpty() )
13.13 + {
13.14 + me->setDefXLinkWidth(atts.value("xlinkWidth").toInt ());
13.15 + }
13.16 }
13.17 } else if ( eName == "select" && state == StateMap )
13.18 {
13.19 @@ -513,13 +522,19 @@
13.20 bool mapBuilderHandler::readXLinkAttr (const QXmlAttributes& a)
13.21 {
13.22 QColor col;
13.23 + bool okx;
13.24 XLinkObj *xlo=new XLinkObj (mc->getCanvas());
13.25 - if (!a.value( "xLinkColor").isEmpty() )
13.26 + if (!a.value( "color").isEmpty() )
13.27 {
13.28 - col.setNamedColor(a.value("xLinkColor"));
13.29 + col.setNamedColor(a.value("color"));
13.30 xlo->setColor (col);
13.31 }
13.32
13.33 + if (!a.value( "width").isEmpty() )
13.34 + {
13.35 + xlo->setWidth(a.value ("width").toInt (&okx, 10));
13.36 + }
13.37 +
13.38 if (!a.value( "beginBranch").isEmpty() )
13.39 {
13.40 if (!a.value( "endBranch").isEmpty() )