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
78924b22
Commit
78924b22
authored
Apr 23, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added getStyle
parent
be542bcb
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
34 deletions
+43
-34
node.js
src/core/node.js
+8
-10
icon.js
src/module/icon.js
+21
-20
layout.bottom.js
src/module/layout.bottom.js
+5
-2
layout.default.js
src/module/layout.default.js
+5
-2
layout.js
src/module/layout.js
+4
-0
No files found.
src/core/node.js
View file @
78924b22
...
...
@@ -19,8 +19,6 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
this
.
_createBgGroup
();
this
.
_createContGroup
();
this
.
_createIconShape
();
this
.
_createTextShape
();
},
_createGroup
:
function
(
type
)
{
var
g
=
new
kity
.
Group
();
...
...
@@ -38,11 +36,11 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
textShape
.
setAttr
(
'_nodeTextShape'
,
true
);
this
.
getContRc
().
appendShape
(
textShape
);
},
_createIconShape
:
function
()
{
var
g
=
new
kity
.
Group
();
this
.
getContRc
().
appendShape
(
g
);
this
.
_iconRc
=
g
;
},
//
_createIconShape: function () {
//
var g = new kity.Group();
//
this.getContRc().appendShape( g );
//
this._iconRc = g;
//
},
getContRc
:
function
()
{
var
groups
=
this
.
rc
.
getShapesByType
(
'group'
),
result
;
...
...
@@ -65,9 +63,9 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
}
);
return
result
;
},
getIconRc
:
function
()
{
return
this
.
_iconRc
;
},
//
getIconRc: function () {
//
return this._iconRc;
//
},
setPoint
:
function
(
x
,
y
)
{
if
(
arguments
.
length
<
2
)
{
this
.
setData
(
"point"
,
x
);
...
...
src/module/icon.js
View file @
78924b22
...
...
@@ -91,26 +91,27 @@ KityMinder.registerModule( "IconModule", function () {
},
"events"
:
{
"RenderNodeLeft"
:
function
(
e
)
{
var
node
=
e
.
node
;
var
iconRc
=
node
.
getIconRc
();
var
contRc
=
node
.
getContRc
();
var
PriorityIconVal
=
node
.
getData
(
"PriorityIcon"
);
var
ProgressIconVal
=
node
.
getData
(
"ProgressIcon"
);
//依次排布图标、文字
iconRc
.
clear
();
var
PriorityIconWidth
=
0
;
if
(
PriorityIconVal
)
{
renderPriorityIcon
(
node
,
PriorityIconVal
);
PriorityIconWidth
=
22
;
}
if
(
ProgressIconVal
)
{
renderProgressIcon
(
node
,
ProgressIconVal
,
PriorityIconWidth
+
10
);
}
var
iconWidth
=
iconRc
.
getWidth
();
var
textShape
=
node
.
getTextShape
();
if
(
iconWidth
)
textShape
.
setTransform
(
new
kity
.
Matrix
().
translate
(
iconWidth
+
5
,
0
)
);
else
textShape
.
setTransform
(
new
kity
.
Matrix
().
translate
(
0
,
0
)
);
iconRc
.
setTransform
(
new
kity
.
Matrix
().
translate
(
0
,
-
(
iconRc
.
getHeight
()
+
textShape
.
getHeight
()
)
/
2
)
);
//alert( '111111' );
// var node = e.node;
// var iconRc = node.getIconRc();
// var contRc = node.getContRc();
// var PriorityIconVal = node.getData( "PriorityIcon" );
// var ProgressIconVal = node.getData( "ProgressIcon" );
// //依次排布图标、文字
// iconRc.clear();
// var PriorityIconWidth = 0;
// if ( PriorityIconVal ) {
// renderPriorityIcon( node, PriorityIconVal );
// PriorityIconWidth = 22;
// }
// if ( ProgressIconVal ) {
// renderProgressIcon( node, ProgressIconVal, PriorityIconWidth + 10 );
// }
// var iconWidth = iconRc.getWidth();
// var textShape = node.getTextShape();
// if ( iconWidth ) textShape.setTransform( new kity.Matrix().translate( iconWidth + 5, 0 ) );
// else textShape.setTransform( new kity.Matrix().translate( 0, 0 ) );
// iconRc.setTransform( new kity.Matrix().translate( 0, -( iconRc.getHeight() + textShape.getHeight() ) / 2 ) );
}
}
};
...
...
src/module/layout.bottom.js
View file @
78924b22
...
...
@@ -123,8 +123,8 @@ KityMinder.registerModule( "LayoutBottom", function () {
var
Layout
=
node
.
getLayout
();
var
nodeType
=
node
.
getType
();
var
nodeStyle
=
nodeStyles
[
nodeType
];
var
txtShape
=
node
.
getTextShape
();
txtShape
.
fill
(
nodeStyle
.
color
).
setSize
(
nodeStyle
.
fontSize
).
setY
(
-
3
);
//
var txtShape = node.getTextShape();
//
txtShape.fill( nodeStyle.color ).setSize( nodeStyle.fontSize ).setY( -3 );
if
(
nodeType
===
"main"
)
{
var
subgroup
=
Layout
.
subgroup
=
new
kity
.
Group
();
minder
.
getRenderContainer
().
addShape
(
subgroup
);
...
...
@@ -330,6 +330,9 @@ KityMinder.registerModule( "LayoutBottom", function () {
}
};
var
_style
=
{
getCurrentLayoutStyle
:
function
()
{
return
nodeStyles
;
},
highlightNode
:
function
(
node
)
{
var
highlight
=
node
.
isHighlight
();
var
nodeType
=
node
.
getType
();
...
...
src/module/layout.default.js
View file @
78924b22
...
...
@@ -133,8 +133,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
var
Layout
=
node
.
getLayout
();
var
nodeType
=
node
.
getType
();
var
nodeStyle
=
nodeStyles
[
nodeType
];
var
txtShape
=
node
.
getTextShape
();
txtShape
.
fill
(
nodeStyle
.
color
).
setSize
(
nodeStyle
.
fontSize
).
setY
(
-
3
);
//
var txtShape = node.getTextShape();
//
txtShape.fill( nodeStyle.color ).setSize( nodeStyle.fontSize ).setY( -3 );
if
(
nodeType
===
"root"
)
{
Layout
.
leftList
=
[];
Layout
.
rightList
=
[];
...
...
@@ -409,6 +409,9 @@ KityMinder.registerModule( "LayoutDefault", function () {
};
var
_style
=
{
getCurrentLayoutStyle
:
function
()
{
return
nodeStyles
;
},
highlightNode
:
function
(
node
)
{
var
highlight
=
node
.
isHighlight
();
var
nodeType
=
node
.
getType
();
...
...
src/module/layout.js
View file @
78924b22
...
...
@@ -7,6 +7,7 @@ KityMinder.registerModule( "LayoutModule", function () {
getLayoutStyle
:
function
(
name
)
{
return
this
.
_layoutStyles
[
name
];
},
getLayoutStyleItems
:
function
()
{
var
items
=
[];
for
(
var
key
in
this
.
_layoutStyles
)
{
...
...
@@ -23,6 +24,9 @@ KityMinder.registerModule( "LayoutModule", function () {
_root
.
setData
(
"currentstyle"
,
name
);
return
name
;
},
getCurrentLayoutStyle
:
function
()
{
this
.
getLayoutStyle
(
curStyle
).
getCurrentLayoutStyle
.
call
(
this
);
},
highlightNode
:
function
(
node
)
{
var
curStyle
=
this
.
getCurrentStyle
();
this
.
getLayoutStyle
(
curStyle
).
highlightNode
.
call
(
this
,
node
);
...
...
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