mxgraph中修改、添加源码自带的图元

在grapheditor文件夹下的sidebar.js中存放的是所有自带的图元,当然某些SVG图元是放在一些以xml为后缀名的文件中的,比如arrows.xml是存放所有的粗体的箭头。

//初始化图元库类
Sidebar.prototype.init = function() {
	var dir = STENCIL_PATH;
    //引入搜索框
	this.addSearchPalette(true);
    //引入自定义画好的基本图元
	this.addGeneralPalette(true);

	//箭头对应的(所有的箭头存放在arrows.xml中)
	this.addStencilPalette('arrows', mxResources.get('arrows'), dir + '/arrows.xml',
		';whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#000000;strokeWidth=2');

    //管道
	this.addImagePalette('pipe', '管道', dir + '/pipe/', '.svg', ['Long vertical pipe', 'Flange with bolts on top','Right angle 4', 'Double flange with bolts - vertical', '45angle 3', '90curve', '45angle 6','Double flange with bolts - horizontal', 'Tee 3', '60angle 4', 'Reducer 3', 'Hairpin turn up', '45angle 5','45angle 1', '180angle 4', 'Flange - horizontal', 'Tee 3', '60angle 7', 'Intersection 3', '60angle 2','120straight (long)', 'Right angle 2', '150straight (short)', 'Tee 8', '30angle 2', 'Open end 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章