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 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章