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
Show 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 @@
...
@@ -5,7 +5,7 @@
<script
src=
"../kity/dist/kitygraph.all.js"
></script>
<script
src=
"../kity/dist/kitygraph.all.js"
></script>
<script
src=
"../dist/dev.php"
></script>
<script
src=
"../dist/dev.php"
></script>
</head>
</head>
<body
style=
"background:#262626"
>
<body
style=
"background:#262626
; margin:0; padding:0
"
>
</body>
</body>
<script>
<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
()
{
...
@@ -13,19 +16,19 @@ var Command = kity.createClass( "Command", {
...
@@ -13,19 +16,19 @@ var Command = kity.createClass( "Command", {
},
},
setContentChanged
:
function
(
val
)
{
setContentChanged
:
function
(
val
)
{
_isContentChange
=
typeof
(
val
)
===
"boolean"
?
val
:
_isContentChange
;
},
},
isContentChanged
:
function
()
{
isContentChanged
:
function
()
{
return
tru
e
;
return
_isContentChang
e
;
},
},
setSelectionChanged
:
function
(
val
)
{
setSelectionChanged
:
function
(
val
)
{
_isSelectionChange
=
typeof
(
val
)
===
"boolean"
?
val
:
_isSelectionChange
;
},
},
isSelectionChanged
:
function
()
{
isSelectionChanged
:
function
()
{
return
fals
e
;
return
_isSelectionChang
e
;
},
},
queryState
:
function
(
km
)
{
queryState
:
function
(
km
)
{
...
@@ -35,4 +38,5 @@ var Command = kity.createClass( "Command", {
...
@@ -35,4 +38,5 @@ var Command = kity.createClass( "Command", {
queryValue
:
function
(
km
)
{
queryValue
:
function
(
km
)
{
return
0
;
return
0
;
}
}
}
);
};
\ No newline at end of file
}
)()
);
\ No newline at end of file
src/core/kityminder.js
View file @
ae6c0298
...
@@ -20,6 +20,10 @@ var KityMinder = km.KityMinder = kity.createClass( "KityMinder", {
...
@@ -20,6 +20,10 @@ var KityMinder = km.KityMinder = kity.createClass( "KityMinder", {
getRenderContainer
:
function
()
{
getRenderContainer
:
function
()
{
return
this
.
_rc
;
return
this
.
_rc
;
},
getPaper
:
function
()
{
return
this
.
_paper
;
}
}
}
);
}
);
...
...
src/module/render.js
View file @
ae6c0298
...
@@ -12,6 +12,10 @@ KityMinder.registerModule( "RenderModule", function () {
...
@@ -12,6 +12,10 @@ KityMinder.registerModule( "RenderModule", function () {
var
drawRectNode
=
function
(
node
)
{
var
drawRectNode
=
function
(
node
)
{
if
(
!
node
)
{
if
(
!
node
)
{
node
=
node_default
;
node
=
node_default
;
}
else
{
for
(
var
key
in
node_default
)
{
node
[
key
]
=
node
[
key
]
||
node_default
[
key
];
}
}
}
var
_node
=
new
kity
.
Group
();
var
_node
=
new
kity
.
Group
();
var
_rect
=
new
kity
.
Rect
();
var
_rect
=
new
kity
.
Rect
();
...
@@ -19,9 +23,11 @@ KityMinder.registerModule( "RenderModule", function () {
...
@@ -19,9 +23,11 @@ KityMinder.registerModule( "RenderModule", function () {
_rect
_rect
.
setRadius
(
node
.
radius
)
.
setRadius
(
node
.
radius
)
.
setSize
(
100
,
100
)
.
setSize
(
100
,
100
)
.
setPosition
(
20
,
2
0
)
.
setPosition
(
0
,
0
)
.
fill
(
node
.
fill
)
.
fill
(
node
.
fill
)
.
stroke
(
node
.
stroke
);
.
stroke
(
node
.
stroke
);
_text
.
setX
(
30
).
setY
(
30
);
console
.
log
(
_text
.
getWidth
()
);
_node
.
addItems
(
[
_rect
,
_text
]
);
_node
.
addItems
(
[
_rect
,
_text
]
);
return
_node
;
return
_node
;
};
};
...
@@ -31,12 +37,11 @@ KityMinder.registerModule( "RenderModule", function () {
...
@@ -31,12 +37,11 @@ KityMinder.registerModule( "RenderModule", function () {
var
kR
=
km
.
getRenderContainer
();
var
kR
=
km
.
getRenderContainer
();
var
_root
=
km
.
getRoot
()
||
new
MinderNode
();
var
_root
=
km
.
getRoot
()
||
new
MinderNode
();
var
_node
=
drawRectNode
(
node
);
var
_node
=
drawRectNode
(
node
);
console
.
log
(
_node
);
console
.
log
(
_node
.
getShapes
()[
1
]
);
kR
.
addShape
(
_node
,
"
background
"
);
kR
.
addShape
(
_node
,
"
node
"
);
}
}
};
};
}
)()
);
}
)()
);
// var DrawShapeCommand = kity.createClass( "DrawShapeCommand", {
// var DrawShapeCommand = kity.createClass( "DrawShapeCommand", {
// base: Command,
// base: Command,
// execute: function ( km, node ) {
// 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