显示二叉树图 Panel
来源:互联网 发布:2017淘宝卖童装怎么样 编辑:程序博客网 时间:2024/06/05 20:45
最近在做这方面的项目,需要用到圆形的背景以及在其中显示图品以及信息,在此和大家分享一下
var $ = go.GraphObject.make;
var myDiagram =
$(go.Diagram, "myDiagramDiv",
{
initialContentAlignment: go.Spot.Center, // center Diagram contents
"undoManager.isEnabled": true, // enable Ctrl-Z toundo and Ctrl-Y to redo
layout: $(go.TreeLayout, // specify a Diagram.layout that arranges trees
{ angle: 90, layerSpacing:25 })
});
//连接线条的设置
myDiagram.linkTemplate =
$(go.Link,
{ routing: go.Link.Orthogonal, corner: 5 },
$(go.Shape, { strokeWidth: 2, stroke: "#555" })
);
//方法1: 节点设置
// myDiagram.nodeTemplate =$(go.Node, "Horizontal",
// { background: "#44CCFF",height:60,defaultStretch: go.GraphObject.Horizontal},
// $(go.Picture,
// { margin: 10, width: 30, height: 30, background: "red"},
// new go.Binding("source")),
// $(go.TextBlock, "Default Text",
// { margin: 4, stroke: "white",alignment: go.Spot.Left, font: "bold 12px sans-serif",isMultiline: true, textAlign: "center"},
// new go.Binding("text", "hu_nickname"))
// );
//方法2: 节点设置
myDiagram.nodeTemplate =
$(go.Node, "Auto",
{ deletable: false,width:100},
new go.Binding("text", "name"),
$(go.Shape, "Circle",
{ fill: "#39bddb",
stroke: null
// stretch: go.GraphObject.Fill,
// alignment: go.Spot.Top
},
new go.Binding("fill")),
$(go.Panel, "Vertical",
$(go.Panel,"Spot",
{ isClipping: true },
$(go.Shape, "Circle",
{ fill: "#fff",width:40},
new go.Binding("fill")),
$(go.Picture,
{ margin: 2, width: 45, height: 45, background: "red"},
new go.Binding("source"))
),
$(go.TextBlock,"Default Text",
{ margin: 4, stroke: "white",font: "bold 12px sans-serif"},
new go.Binding("text", "hu_nickname"))
)
);
var model = $(go.TreeModel);
model.nodeDataArray =
[
{ key: "1", hu_nickname: "Don Meow",source: "img/cat1.png" },
{ key: "2", parent: "1", hu_nickname: "Demeter",source: "img/cat2.png" },
{ key: "3", parent: "1", hu_nickname: "Copricat", source: "img/cat3.png" },
{ key: "4", parent: "3", hu_nickname: "Jellylo", source: "img/cat4.png" },
{ key: "5", parent: "3", hu_nickname: "Alonzo", source: "img/cat5.png" },
{ key: "6", parent: "2", hu_nickname: "Munkus", source: "img/cat6.png" }
];
myDiagram.model = model;
var Select_Port = null;
效果图如下
- 显示二叉树图 Panel
- Panel透明显示闪烁
- panel 显示winform
- ubuntu panel显示异常
- 树状显示二叉树
- 格式化显示二叉树
- 显示二叉树
- 【蓝桥杯】显示二叉树
- 蓝桥杯 显示二叉树
- 使用定时器切换Panel显示
- ubuntu10.04 panel不显示,修复gnome的panel
- 显示二叉树的算法
- 二叉树的图形显示
- 二叉树图形显示(VC)
- 蓝桥杯决赛-----显示二叉树
- 二叉树的横向显示
- [VB.NET]Panel中不显示内容?
- Panel中显示多行工具栏(tbar)
- python在cmd窗口显示彩色文字
- knockout获取当前点击DOM和当前行数据
- 2018有赞校招笔试题
- C++(7) 不同类之间的相互调用
- C/C++基础-C语言重入函数
- 显示二叉树图 Panel
- getter 和 setter 方法有什么意义?
- Java并发编程:volatile关键字解析
- AFNetworking源码剖析
- 10.Java命名空间
- 对物联网的安防,您又懂多少呢?
- 图像数据处理(3)
- NIO 学习(三) channel(主要介绍channel----FileChannel详解--通道间的信息传输)
- sso 单点登录cas使用(1): cas 4.2.7 maven cas-overlay部署服务端