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
ae6c0298
Commit
ae6c0298
authored
Dec 23, 2013
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev
parent
ae81c95e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
31 deletions
+44
-31
dev.html
demo/dev.html
+1
-1
command.js
src/core/command.js
+30
-26
kityminder.js
src/core/kityminder.js
+4
-0
render.js
src/module/render.js
+9
-4
No files found.
demo/dev.html
View file @
ae6c0298
...
...
@@ -5,7 +5,7 @@
<script
src=
"../kity/dist/kitygraph.all.js"
></script>
<script
src=
"../dist/dev.php"
></script>
</head>
<body
style=
"background:#262626"
>
<body
style=
"background:#262626
; margin:0; padding:0
"
>
</body>
<script>
...
...
src/core/command.js
View file @
ae6c0298
var
Command
=
kity
.
createClass
(
"Command"
,
{
var
Command
=
kity
.
createClass
(
"Command"
,
(
function
()
{
var
_isContentChange
=
true
;
var
_isSelectionChange
=
false
;
return
{
constructor
:
function
()
{
constructor
:
function
()
{
},
},
execute
:
function
(
minder
,
args
)
{
execute
:
function
(
minder
,
args
)
{
},
},
revert
:
function
()
{
revert
:
function
()
{
},
},
setContentChanged
:
function
(
val
)
{
setContentChanged
:
function
(
val
)
{
_isContentChange
=
typeof
(
val
)
===
"boolean"
?
val
:
_isContentChange
;
},
},
isContentChanged
:
function
()
{
return
_isContentChange
;
},
isContentChanged
:
function
(
)
{
return
tru
e
;
},
setSelectionChanged
:
function
(
val
)
{
_isSelectionChange
=
typeof
(
val
)
===
"boolean"
?
val
:
_isSelectionChang
e
;
},
setSelectionChanged
:
function
(
val
)
{
isSelectionChanged
:
function
()
{
return
_isSelectionChange
;
},
},
queryState
:
function
(
km
)
{
return
0
;
},
isSelectionChanged
:
function
()
{
return
false
;
},
queryState
:
function
(
km
)
{
return
0
;
},
queryValue
:
function
(
km
)
{
return
0
;
}
}
);
\ No newline at end of file
queryValue
:
function
(
km
)
{
return
0
;
}
};
}
)()
);
\ No newline at end of file
src/core/kityminder.js
View file @
ae6c0298
...
...
@@ -20,6 +20,10 @@ var KityMinder = km.KityMinder = kity.createClass( "KityMinder", {
getRenderContainer
:
function
()
{
return
this
.
_rc
;
},
getPaper
:
function
()
{
return
this
.
_paper
;
}
}
);
...
...
src/module/render.js
View file @
ae6c0298
...
...
@@ -12,6 +12,10 @@ KityMinder.registerModule( "RenderModule", function () {
var
drawRectNode
=
function
(
node
)
{
if
(
!
node
)
{
node
=
node_default
;
}
else
{
for
(
var
key
in
node_default
)
{
node
[
key
]
=
node
[
key
]
||
node_default
[
key
];
}
}
var
_node
=
new
kity
.
Group
();
var
_rect
=
new
kity
.
Rect
();
...
...
@@ -19,9 +23,11 @@ KityMinder.registerModule( "RenderModule", function () {
_rect
.
setRadius
(
node
.
radius
)
.
setSize
(
100
,
100
)
.
setPosition
(
20
,
2
0
)
.
setPosition
(
0
,
0
)
.
fill
(
node
.
fill
)
.
stroke
(
node
.
stroke
);
_text
.
setX
(
30
).
setY
(
30
);
console
.
log
(
_text
.
getWidth
()
);
_node
.
addItems
(
[
_rect
,
_text
]
);
return
_node
;
};
...
...
@@ -31,12 +37,11 @@ KityMinder.registerModule( "RenderModule", function () {
var
kR
=
km
.
getRenderContainer
();
var
_root
=
km
.
getRoot
()
||
new
MinderNode
();
var
_node
=
drawRectNode
(
node
);
console
.
log
(
_node
);
kR
.
addShape
(
_node
,
"
background
"
);
console
.
log
(
_node
.
getShapes
()[
1
]
);
kR
.
addShape
(
_node
,
"
node
"
);
}
};
}
)()
);
// var DrawShapeCommand = kity.createClass( "DrawShapeCommand", {
// base: Command,
// execute: function ( km, 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