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
d5fa216f
Commit
d5fa216f
authored
Jan 31, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed style
parent
67ad6bd8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
14 deletions
+27
-14
layout.default.js
src/module/layout.default.js
+27
-14
No files found.
src/module/layout.default.js
View file @
d5fa216f
...
...
@@ -3,9 +3,25 @@ KityMinder.registerModule( "LayoutDefault", function () {
var
minderWidth
=
_target
.
clientWidth
;
var
minderHeight
=
_target
.
clientHeight
;
var
minder
=
this
;
var
hideIcon
=
kity
.
createClass
(
"hide
Icon"
,
(
function
()
{
var
shIcon
=
kity
.
createClass
(
"Defaultsh
Icon"
,
(
function
()
{
return
{
constructor
:
function
(
node
)
{
this
.
_node
=
node
;
var
nodeLayout
=
node
.
getData
(
"layout"
);
this
.
shape
=
new
kity
.
Group
();
this
.
_circle
=
new
kity
.
Circle
();
this
.
_plus
=
new
kity
.
Path
();
this
.
_dec
=
new
kity
.
Path
();
},
switch
:
function
(
show
)
{
},
update
:
function
()
{
},
remove
:
function
()
{
}
};
}
)()
);
//主分支
...
...
@@ -23,9 +39,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
connect
.
addShapes
(
[
bezier
,
circle
]
);
minder
.
getRenderContainer
().
addShape
(
connect
).
bringTop
(
minder
.
getRoot
().
getRenderContainer
()
);
var
Layout
=
{
radius
:
10
,
fill
:
"gray"
,
stroke
:
new
kity
.
Pen
(
"white"
,
2
),
radius
:
0
,
fill
:
"white"
,
color
:
"black"
,
padding
:
[
5.5
,
20
,
5.5
,
20
],
fontSize
:
20
,
...
...
@@ -48,7 +63,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
var
_txtHeight
=
txt
.
getHeight
();
var
_rectWidth
=
_txtWidth
+
Layout
.
padding
[
1
]
+
Layout
.
padding
[
3
];
var
_rectHeight
=
_txtHeight
+
Layout
.
padding
[
0
]
+
Layout
.
padding
[
2
];
rect
.
setWidth
(
_rectWidth
).
setHeight
(
_rectHeight
).
fill
(
node
.
getData
(
"highlight"
)
?
"chocolate"
:
Layout
.
fill
).
s
troke
(
node
.
getData
(
"highlight"
)
?
new
kity
.
Pen
(
"white"
,
3
)
:
Layout
.
stroke
).
s
etRadius
(
Layout
.
radius
);
rect
.
setWidth
(
_rectWidth
).
setHeight
(
_rectHeight
).
fill
(
node
.
getData
(
"highlight"
)
?
"chocolate"
:
Layout
.
fill
).
setRadius
(
Layout
.
radius
);
this
.
updateConnect
();
},
updateConnect
:
function
()
{
...
...
@@ -73,7 +88,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
var
endPosV
=
endPos
.
getVertex
();
sPos
.
setVertex
(
rootX
,
rootY
);
connect
.
bezier
.
setPoints
(
[
sPos
,
endPos
]
).
stroke
(
"white"
);
connect
.
circle
.
setCenter
(
endPosV
.
x
+
(
Layout
.
appendside
===
"left"
?
5
:
-
5
),
endPosV
.
y
).
fill
(
"white"
).
stroke
(
"gray"
).
setRadius
(
3
);
connect
.
circle
.
setCenter
(
endPosV
.
x
+
(
Layout
.
appendside
===
"left"
?
5
:
-
5
),
endPosV
.
y
).
fill
(
"white"
).
stroke
(
"gray"
).
setRadius
(
4
);
},
clear
:
function
()
{
this
.
_node
.
getRenderContainer
().
clear
();
...
...
@@ -94,10 +109,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
var
connect
=
this
.
_connect
=
new
kity
.
Path
();
minder
.
getRenderContainer
().
addShape
(
connect
).
bringTop
(
minder
.
getRoot
().
getRenderContainer
()
);
var
Layout
=
{
radius
:
10
,
fill
:
"skyblue"
,
stroke
:
new
kity
.
Pen
(
"white"
,
2
).
setLineCap
(
"round"
),
color
:
"#ccc"
,
stroke
:
new
kity
.
Pen
(
"white"
,
1
).
setLineCap
(
"round"
),
color
:
"white"
,
padding
:
[
5
,
10
,
5
,
10
],
fontSize
:
12
,
margin
:
[
0
,
10
,
20
,
5
],
...
...
@@ -107,7 +120,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
};
node
.
setData
(
"layout"
,
Layout
);
txt
.
translate
(
Layout
.
padding
[
3
],
Layout
.
padding
[
0
]
+
10
);
highlightshape
.
setRadius
(
5
).
fill
(
"chocolate"
).
translate
(
-
1
,
0
).
stroke
(
new
kity
.
Pen
(
"white"
,
3
)
);
highlightshape
.
fill
(
"chocolate"
).
translate
(
-
1
,
0
);
this
.
update
();
},
update
:
function
()
{
...
...
@@ -188,8 +201,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
rightList
:
[],
color
:
"white"
,
fontSize
:
20
,
fill
:
"
burlywood
"
,
stroke
:
n
ew
kity
.
Pen
(
"white"
,
2
)
,
fill
:
"
cadetblue
"
,
stroke
:
n
ull
,
padding
:
[
10.5
,
10
,
10.5
,
10
],
radius
:
15
,
margin
:
[
0
,
0
,
0
,
0
]
...
...
@@ -210,7 +223,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
var
_txtHeight
=
txt
.
getHeight
();
var
_rectWidth
=
_txtWidth
+
Layout
.
padding
[
1
]
+
Layout
.
padding
[
3
];
var
_rectHeight
=
_txtHeight
+
Layout
.
padding
[
0
]
+
Layout
.
padding
[
2
];
rect
.
setWidth
(
_rectWidth
).
setHeight
(
_rectHeight
).
fill
(
node
.
getData
(
"highlight"
)
?
"chocolate"
:
Layout
.
fill
).
s
troke
(
node
.
getData
(
"highlight"
)
?
new
kity
.
Pen
(
"white"
,
3
)
:
Layout
.
stroke
).
s
etRadius
(
Layout
.
radius
);
rect
.
setWidth
(
_rectWidth
).
setHeight
(
_rectHeight
).
fill
(
node
.
getData
(
"highlight"
)
?
"chocolate"
:
Layout
.
fill
).
setRadius
(
Layout
.
radius
);
},
clear
:
function
()
{
this
.
_node
.
getRenderContainer
().
clear
();
...
...
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