Commit d5fa216f authored by Akikonata's avatar Akikonata

changed style

parent 67ad6bd8
...@@ -3,9 +3,25 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -3,9 +3,25 @@ KityMinder.registerModule( "LayoutDefault", function () {
var minderWidth = _target.clientWidth; var minderWidth = _target.clientWidth;
var minderHeight = _target.clientHeight; var minderHeight = _target.clientHeight;
var minder = this; var minder = this;
var hideIcon = kity.createClass( "hideIcon", ( function () { var shIcon = kity.createClass( "DefaultshIcon", ( function () {
return { 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 () { ...@@ -23,9 +39,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
connect.addShapes( [ bezier, circle ] ); connect.addShapes( [ bezier, circle ] );
minder.getRenderContainer().addShape( connect ).bringTop( minder.getRoot().getRenderContainer() ); minder.getRenderContainer().addShape( connect ).bringTop( minder.getRoot().getRenderContainer() );
var Layout = { var Layout = {
radius: 10, radius: 0,
fill: "gray", fill: "white",
stroke: new kity.Pen( "white", 2 ),
color: "black", color: "black",
padding: [ 5.5, 20, 5.5, 20 ], padding: [ 5.5, 20, 5.5, 20 ],
fontSize: 20, fontSize: 20,
...@@ -48,7 +63,7 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -48,7 +63,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
var _txtHeight = txt.getHeight(); var _txtHeight = txt.getHeight();
var _rectWidth = _txtWidth + Layout.padding[ 1 ] + Layout.padding[ 3 ]; var _rectWidth = _txtWidth + Layout.padding[ 1 ] + Layout.padding[ 3 ];
var _rectHeight = _txtHeight + Layout.padding[ 0 ] + Layout.padding[ 2 ]; var _rectHeight = _txtHeight + Layout.padding[ 0 ] + Layout.padding[ 2 ];
rect.setWidth( _rectWidth ).setHeight( _rectHeight ).fill( node.getData( "highlight" ) ? "chocolate" : Layout.fill ).stroke( node.getData( "highlight" ) ? new kity.Pen( "white", 3 ) : Layout.stroke ).setRadius( Layout.radius ); rect.setWidth( _rectWidth ).setHeight( _rectHeight ).fill( node.getData( "highlight" ) ? "chocolate" : Layout.fill ).setRadius( Layout.radius );
this.updateConnect(); this.updateConnect();
}, },
updateConnect: function () { updateConnect: function () {
...@@ -73,7 +88,7 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -73,7 +88,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
var endPosV = endPos.getVertex(); var endPosV = endPos.getVertex();
sPos.setVertex( rootX, rootY ); sPos.setVertex( rootX, rootY );
connect.bezier.setPoints( [ sPos, endPos ] ).stroke( "white" ); 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 () { clear: function () {
this._node.getRenderContainer().clear(); this._node.getRenderContainer().clear();
...@@ -94,10 +109,8 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -94,10 +109,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
var connect = this._connect = new kity.Path(); var connect = this._connect = new kity.Path();
minder.getRenderContainer().addShape( connect ).bringTop( minder.getRoot().getRenderContainer() ); minder.getRenderContainer().addShape( connect ).bringTop( minder.getRoot().getRenderContainer() );
var Layout = { var Layout = {
radius: 10, stroke: new kity.Pen( "white", 1 ).setLineCap( "round" ),
fill: "skyblue", color: "white",
stroke: new kity.Pen( "white", 2 ).setLineCap( "round" ),
color: "#ccc",
padding: [ 5, 10, 5, 10 ], padding: [ 5, 10, 5, 10 ],
fontSize: 12, fontSize: 12,
margin: [ 0, 10, 20, 5 ], margin: [ 0, 10, 20, 5 ],
...@@ -107,7 +120,7 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -107,7 +120,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
}; };
node.setData( "layout", Layout ); node.setData( "layout", Layout );
txt.translate( Layout.padding[ 3 ], Layout.padding[ 0 ] + 10 ); 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(); this.update();
}, },
update: function () { update: function () {
...@@ -188,8 +201,8 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -188,8 +201,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
rightList: [], rightList: [],
color: "white", color: "white",
fontSize: 20, fontSize: 20,
fill: "burlywood", fill: "cadetblue",
stroke: new kity.Pen( "white", 2 ), stroke: null,
padding: [ 10.5, 10, 10.5, 10 ], padding: [ 10.5, 10, 10.5, 10 ],
radius: 15, radius: 15,
margin: [ 0, 0, 0, 0 ] margin: [ 0, 0, 0, 0 ]
...@@ -210,7 +223,7 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -210,7 +223,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
var _txtHeight = txt.getHeight(); var _txtHeight = txt.getHeight();
var _rectWidth = _txtWidth + Layout.padding[ 1 ] + Layout.padding[ 3 ]; var _rectWidth = _txtWidth + Layout.padding[ 1 ] + Layout.padding[ 3 ];
var _rectHeight = _txtHeight + Layout.padding[ 0 ] + Layout.padding[ 2 ]; var _rectHeight = _txtHeight + Layout.padding[ 0 ] + Layout.padding[ 2 ];
rect.setWidth( _rectWidth ).setHeight( _rectHeight ).fill( node.getData( "highlight" ) ? "chocolate" : Layout.fill ).stroke( node.getData( "highlight" ) ? new kity.Pen( "white", 3 ) : Layout.stroke ).setRadius( Layout.radius ); rect.setWidth( _rectWidth ).setHeight( _rectHeight ).fill( node.getData( "highlight" ) ? "chocolate" : Layout.fill ).setRadius( Layout.radius );
}, },
clear: function () { clear: function () {
this._node.getRenderContainer().clear(); this._node.getRenderContainer().clear();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment