initial commit
This commit is contained in:
commit
3751b8ddb0
23 changed files with 2048 additions and 0 deletions
61
src/CustomPaletteModule.ts
Normal file
61
src/CustomPaletteModule.ts
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
function PalettePlugin(palette, lassoTool, create, elementFactory, globalConnect) {
|
||||
palette.registerProvider({
|
||||
getPaletteEntries: () => ({
|
||||
'hand-tool': {
|
||||
group: 'tools',
|
||||
className: 'icon-hand-tool',
|
||||
title: 'Hand Tool',
|
||||
action: {
|
||||
click: function(event) {
|
||||
console.log("Hello");
|
||||
}
|
||||
}
|
||||
},
|
||||
'lasso-tool': {
|
||||
group: 'tools',
|
||||
className: 'icon-lasso-tool',
|
||||
title: 'Lasso Tool',
|
||||
action: {
|
||||
click: function(event) {
|
||||
lassoTool.activateSelection(event);
|
||||
}
|
||||
}
|
||||
},
|
||||
'tool-separator': {
|
||||
group: 'tools',
|
||||
separator: true
|
||||
},
|
||||
'create-shape': {
|
||||
group: 'create',
|
||||
className: 'icon-create-shape',
|
||||
title: 'Create Shape',
|
||||
action: {
|
||||
click: function() {
|
||||
var shape = elementFactory.createShape({
|
||||
width: 100,
|
||||
height: 80,
|
||||
canStartConnection:true
|
||||
});
|
||||
console.log(shape.canStartConnection);
|
||||
create.start(event, shape);
|
||||
}
|
||||
}
|
||||
},
|
||||
'create-connection': {
|
||||
group: 'create',
|
||||
className: 'connection-create-shape',
|
||||
title: 'Create Connection',
|
||||
action: {
|
||||
click: (event) => {
|
||||
globalConnect.start(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
export default {
|
||||
__init__: [ 'palettePlugin' ],
|
||||
palettePlugin: [ 'type', PalettePlugin ]
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue