Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kityminder-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
吴志俊
kityminder-core
Commits
c9d67aef
Commit
c9d67aef
authored
Jan 31, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed style
parent
e48a1ef0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
12 deletions
+13
-12
node.js
src/core/node.js
+4
-5
layout.default.js
src/module/layout.default.js
+8
-7
layout.js
src/module/layout.js
+1
-0
No files found.
src/core/node.js
View file @
c9d67aef
...
...
@@ -3,7 +3,6 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
this
.
parent
=
null
;
this
.
children
=
[];
this
.
data
=
{};
this
.
_type
=
"main"
;
if
(
Utils
.
isString
(
options
)
)
{
this
.
setData
(
'text'
,
options
);
}
else
{
...
...
@@ -22,10 +21,10 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
return
this
.
getData
(
'point'
);
},
setType
:
function
(
type
)
{
this
.
_type
=
type
;
this
.
setData
(
'type'
,
type
)
;
},
getType
:
function
(
type
)
{
return
this
.
_type
;
return
this
.
getData
(
'type'
)
;
},
setText
:
function
(
text
)
{
this
.
setData
(
'text'
,
text
);
...
...
@@ -216,9 +215,9 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
return
true
;
},
getTextShape
:
function
()
{
getTextShape
:
function
()
{
var
rc
=
this
.
getRenderContainer
();
var
text
=
rc
.
getElementsByTagName
(
'text'
);
var
text
=
rc
.
getElementsByTagName
(
'text'
);
}
}
);
\ No newline at end of file
src/module/layout.default.js
View file @
c9d67aef
...
...
@@ -109,9 +109,9 @@ KityMinder.registerModule( "LayoutDefault", function () {
var
connect
=
this
.
_connect
=
new
kity
.
Path
();
minder
.
getRenderContainer
().
addShape
(
connect
).
bringTop
(
minder
.
getRoot
().
getRenderContainer
()
);
var
Layout
=
{
stroke
:
new
kity
.
Pen
(
"white"
,
1
).
setLineCap
(
"round"
),
stroke
:
new
kity
.
Pen
(
"white"
,
1
).
setLineCap
(
"round"
)
.
setLineJoin
(
"round"
)
,
color
:
"white"
,
padding
:
[
5
,
10
,
5
,
10
],
padding
:
[
5
,
10
,
5
.5
,
10
],
fontSize
:
12
,
margin
:
[
0
,
10
,
20
,
5
],
shape
:
this
,
...
...
@@ -156,13 +156,13 @@ KityMinder.registerModule( "LayoutDefault", function () {
var
nodeX
,
nodeY
=
Shape
.
getRenderBox
().
closurePoints
[
1
].
y
;
if
(
Layout
.
appendside
===
"left"
)
{
sX
=
parentBox
.
closurePoints
[
1
].
x
-
parentLayout
.
margin
[
1
];
nodeX
=
Shape
.
getRenderBox
().
closurePoints
[
0
].
x
-
1
;
nodeX
=
Shape
.
getRenderBox
().
closurePoints
[
0
].
x
;
connect
.
getDrawer
()
.
clear
()
.
moveTo
(
sX
,
sY
)
.
lineTo
(
sX
,
nodeY
>
sY
?
(
nodeY
-
Layout
.
margin
[
3
]
)
:
(
nodeY
+
Layout
.
margin
[
3
]
)
);
if
(
nodeY
>
sY
)
connect
.
getDrawer
().
carcTo
(
Layout
.
margin
[
3
],
nodeX
,
nodeY
);
else
connect
.
getDrawer
().
carcTo
(
Layout
.
margin
[
3
],
nodeX
,
nodeY
,
0
,
1
);
if
(
nodeY
>
sY
)
connect
.
getDrawer
().
carcTo
(
Layout
.
margin
[
3
],
nodeX
,
nodeY
,
0
,
1
);
else
connect
.
getDrawer
().
carcTo
(
Layout
.
margin
[
3
],
nodeX
,
nodeY
);
connect
.
stroke
(
Layout
.
stroke
);
}
else
{
sX
=
parentBox
.
closurePoints
[
0
].
x
+
parentLayout
.
margin
[
1
];
...
...
@@ -171,8 +171,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
.
clear
()
.
moveTo
(
sX
,
sY
)
.
lineTo
(
sX
,
nodeY
>
sY
?
(
nodeY
-
Layout
.
margin
[
3
]
)
:
(
nodeY
+
Layout
.
margin
[
3
]
)
);
if
(
nodeY
>
sY
)
connect
.
getDrawer
().
carcTo
(
Layout
.
margin
[
3
],
nodeX
,
nodeY
,
0
,
1
);
else
connect
.
getDrawer
().
carcTo
(
Layout
.
margin
[
3
],
nodeX
,
nodeY
);
if
(
nodeY
>
sY
)
connect
.
getDrawer
().
carcTo
(
Layout
.
margin
[
3
],
nodeX
,
nodeY
);
else
connect
.
getDrawer
().
carcTo
(
Layout
.
margin
[
3
],
nodeX
,
nodeY
,
0
,
1
);
connect
.
stroke
(
Layout
.
stroke
);
}
},
...
...
@@ -373,6 +373,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
initStyle
:
function
()
{
//绘制root并且调整到正确位置
var
_root
=
this
.
getRoot
();
minder
.
getRenderContainer
().
clear
();
minder
.
handelNodeInsert
(
_root
);
var
rc
=
new
RootShape
(
_root
);
translateNode
(
_root
);
...
...
src/module/layout.js
View file @
c9d67aef
...
...
@@ -68,6 +68,7 @@ KityMinder.registerModule( "LayoutModule", function () {
_root
.
preTraverse
(
function
(
n
)
{
n
.
clearLayout
();
n
.
setPoint
();
n
.
getRenderContainer
().
clear
();
}
);
km
.
setCurrentStyle
(
style
);
km
.
initStyle
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment