...
|
...
|
@@ -8,7 +8,8 @@ Format = function(editorUi, container) |
8
|
8
|
};
|
9
|
9
|
|
10
|
10
|
/**
|
11
|
|
- * Background color for inactive tabs.
|
|
11
|
+ * Background color for inactive tabs.
|
|
12
|
+ * 没有激活的tab栏 背景色
|
12
|
13
|
*/
|
13
|
14
|
Format.inactiveTabBackgroundColor = '#f1f3f4';
|
14
|
15
|
|
...
|
...
|
@@ -84,6 +85,7 @@ Format.prototype.labelIndex = 0; |
84
|
85
|
|
85
|
86
|
/**
|
86
|
87
|
* Returns information about the current selection.
|
|
88
|
+ * 默认选中的formatBar的tab栏索引 / 0是第一个
|
87
|
89
|
*/
|
88
|
90
|
Format.prototype.diagramIndex = 0;
|
89
|
91
|
|
...
|
...
|
@@ -94,8 +96,9 @@ Format.prototype.currentIndex = 0; |
94
|
96
|
|
95
|
97
|
/**
|
96
|
98
|
* Returns information about the current selection.
|
|
99
|
+ * 是否显示关闭按钮
|
97
|
100
|
*/
|
98
|
|
-Format.prototype.showCloseButton = true;
|
|
101
|
+Format.prototype.showCloseButton = false;
|
99
|
102
|
|
100
|
103
|
/**
|
101
|
104
|
* Adds the label menu items to the given menu and parent.
|
...
|
...
|
@@ -270,38 +273,37 @@ Format.prototype.immediateRefresh = function() |
270
|
273
|
|
271
|
274
|
if (graph.isSelectionEmpty())
|
272
|
275
|
{
|
273
|
|
- mxUtils.write(label, mxResources.get('diagram'));
|
|
276
|
+ mxUtils.write(label, mxResources.get("pageSetting"));
|
274
|
277
|
label.style.borderLeftWidth = '0px';
|
275
|
|
-
|
276
|
278
|
div.appendChild(label);
|
277
|
279
|
var diagramPanel = div.cloneNode(false);
|
278
|
280
|
this.panels.push(new DiagramFormatPanel(this, ui, diagramPanel));
|
279
|
281
|
this.container.appendChild(diagramPanel);
|
280
|
|
-
|
|
282
|
+
|
281
|
283
|
if (Editor.styles != null)
|
282
|
284
|
{
|
283
|
|
- diagramPanel.style.display = 'none';
|
284
|
|
- label.style.width = (this.showCloseButton) ? '106px' : '50%';
|
285
|
|
- label.style.cursor = 'pointer';
|
286
|
|
- label.style.backgroundColor = Format.inactiveTabBackgroundColor;
|
|
285
|
+ // diagramPanel.style.display = 'none';
|
|
286
|
+ // label.style.width = (this.showCloseButton) ? '106px' : '50%';
|
|
287
|
+ // label.style.cursor = 'pointer';
|
|
288
|
+ // label.style.backgroundColor = Format.inactiveTabBackgroundColor;
|
287
|
289
|
|
288
|
|
- var label2 = label.cloneNode(false);
|
289
|
|
- label2.style.borderLeftWidth = '1px';
|
290
|
|
- label2.style.borderRightWidth = '1px';
|
291
|
|
- label2.style.backgroundColor = Format.inactiveTabBackgroundColor;
|
|
290
|
+ // var label2 = label.cloneNode(false);
|
|
291
|
+ // label2.style.borderLeftWidth = '1px';
|
|
292
|
+ // label2.style.borderRightWidth = '1px';
|
|
293
|
+ // label2.style.backgroundColor = Format.inactiveTabBackgroundColor;
|
292
|
294
|
|
293
|
|
- addClickHandler(label, diagramPanel, idx++);
|
|
295
|
+ // addClickHandler(label, diagramPanel, idx++);
|
294
|
296
|
|
295
|
|
- var stylePanel = div.cloneNode(false);
|
296
|
|
- stylePanel.style.display = 'none';
|
297
|
|
- mxUtils.write(label2, mxResources.get('style'));
|
298
|
|
- div.appendChild(label2);
|
299
|
|
- this.panels.push(new DiagramStylePanel(this, ui, stylePanel));
|
300
|
|
- this.container.appendChild(stylePanel);
|
|
297
|
+ // var stylePanel = div.cloneNode(false);
|
|
298
|
+ // stylePanel.style.display = 'none';
|
|
299
|
+ // mxUtils.write(label2, mxResources.get('style'));
|
|
300
|
+ // div.appendChild(label2);
|
|
301
|
+ // this.panels.push(new DiagramStylePanel(this, ui, stylePanel));
|
|
302
|
+ // this.container.appendChild(stylePanel);
|
301
|
303
|
|
302
|
|
- addClickHandler(label2, stylePanel, idx++);
|
|
304
|
+ // addClickHandler(label2, stylePanel, idx++);
|
303
|
305
|
}
|
304
|
|
-
|
|
306
|
+
|
305
|
307
|
// Adds button to hide the format panel since
|
306
|
308
|
// people don't seem to find the toolbar button
|
307
|
309
|
// and the menu item in the format menu
|
...
|
...
|
@@ -341,14 +343,17 @@ Format.prototype.immediateRefresh = function() |
341
|
343
|
div.appendChild(label2);
|
342
|
344
|
}
|
343
|
345
|
}
|
344
|
|
- else if (graph.isEditing())
|
|
346
|
+ else if (graph.isEditing())
|
345
|
347
|
{
|
346
|
348
|
mxUtils.write(label, mxResources.get('text'));
|
347
|
|
- div.appendChild(label);
|
348
|
|
- this.panels.push(new TextFormatPanel(this, ui, div));
|
349
|
|
- }
|
350
|
|
- else
|
351
|
|
- {
|
|
349
|
+ div.appendChild(label);
|
|
350
|
+ this.panels.push(new TextFormatPanel(this, ui, div));
|
|
351
|
+ }
|
|
352
|
+ else
|
|
353
|
+ {
|
|
354
|
+ /**
|
|
355
|
+ * source
|
|
356
|
+ *
|
352
|
357
|
label.style.backgroundColor = Format.inactiveTabBackgroundColor;
|
353
|
358
|
label.style.borderLeftWidth = '1px';
|
354
|
359
|
label.style.cursor = 'pointer';
|
...
|
...
|
@@ -407,7 +412,56 @@ Format.prototype.immediateRefresh = function() |
407
|
412
|
}
|
408
|
413
|
|
409
|
414
|
addClickHandler(label3, arrangePanel, idx++, true);
|
410
|
|
- }
|
|
415
|
+ */
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+ /**
|
|
420
|
+ * modify
|
|
421
|
+ */
|
|
422
|
+
|
|
423
|
+ label.style.backgroundColor = Format.inactiveTabBackgroundColor;
|
|
424
|
+ label.style.borderLeftWidth = "1px";
|
|
425
|
+ label.style.cursor = "pointer";
|
|
426
|
+ label.style.width = containsLabel || ss.cells.length > 0 ? "50%" : "33.3%";
|
|
427
|
+ var label2 = label.cloneNode(false);
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+ // Workaround for ignored background in IE
|
|
431
|
+ label2.style.backgroundColor = Format.inactiveTabBackgroundColor;
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+ // bindData 绑定数据
|
|
435
|
+ if (containsLabel) {
|
|
436
|
+ label2.style.borderLeftWidth = "0px";
|
|
437
|
+ } else {
|
|
438
|
+ label.style.borderLeftWidth = "0px";
|
|
439
|
+ mxUtils.write(label, mxResources.get("bindData"));
|
|
440
|
+ div.appendChild(label);
|
|
441
|
+
|
|
442
|
+ var bindDataPanel = div.cloneNode(false);
|
|
443
|
+ bindDataPanel.style.display = "none";
|
|
444
|
+ this.panels.push(new StyleFormatPanel(this, ui, bindDataPanel));
|
|
445
|
+ this.container.appendChild(bindDataPanel);
|
|
446
|
+
|
|
447
|
+ addClickHandler(label, bindDataPanel, idx++);
|
|
448
|
+ }
|
|
449
|
+
|
|
450
|
+ // style 样式
|
|
451
|
+ mxUtils.write(label2, mxResources.get("style"));
|
|
452
|
+ div.appendChild(label2);
|
|
453
|
+
|
|
454
|
+ var stylePanel = div.cloneNode(false);
|
|
455
|
+ stylePanel.style.display = "none";
|
|
456
|
+ this.panels.push(new TextFormatPanel(this, ui, stylePanel));
|
|
457
|
+ this.container.appendChild(stylePanel);
|
|
458
|
+
|
|
459
|
+ if (ss.cells.length > 0) {
|
|
460
|
+ addClickHandler(label2, stylePanel, idx++);
|
|
461
|
+ } else {
|
|
462
|
+ label2.style.display = "none";
|
|
463
|
+ }
|
|
464
|
+ }
|
411
|
465
|
};
|
412
|
466
|
|
413
|
467
|
/**
|
...
|
...
|
@@ -2724,7 +2778,7 @@ mxUtils.extend(TextFormatPanel, BaseFormatPanel); |
2724
|
2778
|
TextFormatPanel.prototype.init = function()
|
2725
|
2779
|
{
|
2726
|
2780
|
this.container.style.borderBottom = 'none';
|
2727
|
|
- this.addFont(this.container);
|
|
2781
|
+ // this.addFont(this.container);
|
2728
|
2782
|
};
|
2729
|
2783
|
|
2730
|
2784
|
/**
|
...
|
...
|
@@ -4216,31 +4270,31 @@ StyleFormatPanel.prototype.init = function() |
4216
|
4270
|
if (ss.containsImage && ss.vertices.length == 1 && ss.style.shape == 'image' &&
|
4217
|
4271
|
ss.style.image != null && ss.style.image.substring(0, 19) == 'data:image/svg+xml;')
|
4218
|
4272
|
{
|
4219
|
|
- this.container.appendChild(this.addSvgStyles(this.createPanel()));
|
|
4273
|
+ // this.container.appendChild(this.addSvgStyles(this.createPanel()));
|
4220
|
4274
|
}
|
4221
|
4275
|
|
4222
|
4276
|
if (ss.fill)
|
4223
|
4277
|
{
|
4224
|
|
- this.container.appendChild(this.addFill(this.createPanel()));
|
|
4278
|
+ // this.container.appendChild(this.addFill(this.createPanel()));
|
4225
|
4279
|
}
|
4226
|
4280
|
|
4227
|
|
- this.container.appendChild(this.addStroke(this.createPanel()));
|
4228
|
|
- this.container.appendChild(this.addLineJumps(this.createPanel()));
|
4229
|
|
- var opacityPanel = this.createRelativeOption(mxResources.get('opacity'), mxConstants.STYLE_OPACITY);
|
4230
|
|
- opacityPanel.style.paddingTop = '8px';
|
4231
|
|
- opacityPanel.style.paddingBottom = '8px';
|
4232
|
|
- this.container.appendChild(opacityPanel);
|
4233
|
|
- this.container.appendChild(this.addEffects(this.createPanel()));
|
|
4281
|
+ // this.container.appendChild(this.addStroke(this.createPanel()));
|
|
4282
|
+ // this.container.appendChild(this.addLineJumps(this.createPanel()));
|
|
4283
|
+ // var opacityPanel = this.createRelativeOption(mxResources.get('opacity'), mxConstants.STYLE_OPACITY);
|
|
4284
|
+ // opacityPanel.style.paddingTop = '8px';
|
|
4285
|
+ // opacityPanel.style.paddingBottom = '8px';
|
|
4286
|
+ // this.container.appendChild(opacityPanel);
|
|
4287
|
+ // this.container.appendChild(this.addEffects(this.createPanel()));
|
4234
|
4288
|
}
|
4235
|
4289
|
|
4236
|
|
- var opsPanel = this.addEditOps(this.createPanel());
|
|
4290
|
+ // var opsPanel = this.addEditOps(this.createPanel());
|
4237
|
4291
|
|
4238
|
|
- if (opsPanel.firstChild != null)
|
4239
|
|
- {
|
4240
|
|
- mxUtils.br(opsPanel);
|
4241
|
|
- }
|
|
4292
|
+ // if (opsPanel.firstChild != null)
|
|
4293
|
+ // {
|
|
4294
|
+ // mxUtils.br(opsPanel);
|
|
4295
|
+ // }
|
4242
|
4296
|
|
4243
|
|
- this.container.appendChild(this.addStyleOps(opsPanel));
|
|
4297
|
+ // this.container.appendChild(this.addStyleOps(opsPanel));
|
4244
|
4298
|
};
|
4245
|
4299
|
|
4246
|
4300
|
/**
|
...
|
...
|
@@ -5582,656 +5636,654 @@ DiagramStylePanel.prototype.init = function() |
5582
|
5636
|
});
|
5583
|
5637
|
|
5584
|
5638
|
ui.addListener('darkModeChanged', this.darkModeChangedListener);
|
5585
|
|
- this.container.appendChild(this.addView(this.createPanel()));
|
|
5639
|
+ // this.container.appendChild(this.addView(this.createPanel()));
|
5586
|
5640
|
};
|
5587
|
5641
|
|
5588
|
5642
|
/**
|
5589
|
5643
|
* Adds the label menu items to the given menu and parent.
|
5590
|
5644
|
*/
|
5591
|
|
-DiagramStylePanel.prototype.addView = function(div)
|
5592
|
|
-{
|
5593
|
|
- var ui = this.editorUi;
|
5594
|
|
- var editor = ui.editor;
|
5595
|
|
- var graph = editor.graph;
|
5596
|
|
- var model = graph.getModel();
|
5597
|
|
- var gridColor = graph.view.gridColor;
|
5598
|
|
-
|
5599
|
|
- div.style.whiteSpace = 'normal';
|
5600
|
|
-
|
5601
|
|
- var sketch = graph.currentVertexStyle['sketch'] == '1' && graph.currentEdgeStyle['sketch'] == '1';
|
5602
|
|
- var rounded = graph.currentVertexStyle['rounded'] == '1';
|
5603
|
|
- var curved = graph.currentEdgeStyle['curved'] == '1';
|
5604
|
|
-
|
5605
|
|
- var opts = document.createElement('div');
|
5606
|
|
- opts.style.marginRight = '16px';
|
5607
|
|
- div.style.paddingTop = '8px';
|
5608
|
|
-
|
5609
|
|
- var table = document.createElement('table');
|
5610
|
|
-
|
5611
|
|
- table.style.width = '210px';
|
5612
|
|
- table.style.fontWeight = 'bold';
|
5613
|
|
-
|
5614
|
|
- var tbody = document.createElement('tbody');
|
5615
|
|
- var row = document.createElement('tr');
|
5616
|
|
- row.style.padding = '0px';
|
5617
|
|
-
|
5618
|
|
- var left = document.createElement('td');
|
5619
|
|
- left.style.padding = '0px';
|
5620
|
|
- left.style.width = '50%';
|
5621
|
|
- left.setAttribute('valign', 'middle');
|
5622
|
|
-
|
5623
|
|
- var right = left.cloneNode(true);
|
5624
|
|
- right.style.paddingLeft = '8px';
|
5625
|
|
-
|
5626
|
|
- // Sketch
|
5627
|
|
- if (urlParams['sketch'] != '1')
|
5628
|
|
- {
|
5629
|
|
- opts.style.paddingBottom = '12px';
|
5630
|
|
- row.appendChild(left);
|
5631
|
|
-
|
5632
|
|
- left.appendChild(this.createOption(mxResources.get('sketch'), function()
|
5633
|
|
- {
|
5634
|
|
- return sketch;
|
5635
|
|
- }, function(checked)
|
5636
|
|
- {
|
5637
|
|
- sketch = checked;
|
|
5645
|
+// DiagramStylePanel.prototype.addView = function(div)
|
|
5646
|
+// {
|
|
5647
|
+// var ui = this.editorUi;
|
|
5648
|
+// var editor = ui.editor;
|
|
5649
|
+// var graph = editor.graph;
|
|
5650
|
+// var model = graph.getModel();
|
|
5651
|
+// var gridColor = graph.view.gridColor;
|
|
5652
|
+
|
|
5653
|
+// div.style.whiteSpace = 'normal';
|
|
5654
|
+
|
|
5655
|
+// var sketch = graph.currentVertexStyle['sketch'] == '1' && graph.currentEdgeStyle['sketch'] == '1';
|
|
5656
|
+// var rounded = graph.currentVertexStyle['rounded'] == '1';
|
|
5657
|
+// var curved = graph.currentEdgeStyle['curved'] == '1';
|
|
5658
|
+
|
|
5659
|
+// var opts = document.createElement('div');
|
|
5660
|
+// opts.style.marginRight = '16px';
|
|
5661
|
+// div.style.paddingTop = '8px';
|
|
5662
|
+
|
|
5663
|
+// var table = document.createElement('table');
|
|
5664
|
+
|
|
5665
|
+// table.style.width = '210px';
|
|
5666
|
+// table.style.fontWeight = 'bold';
|
|
5667
|
+
|
|
5668
|
+// var tbody = document.createElement('tbody');
|
|
5669
|
+// var row = document.createElement('tr');
|
|
5670
|
+// row.style.padding = '0px';
|
|
5671
|
+
|
|
5672
|
+// var left = document.createElement('td');
|
|
5673
|
+// left.style.padding = '0px';
|
|
5674
|
+// left.style.width = '50%';
|
|
5675
|
+// left.setAttribute('valign', 'middle');
|
|
5676
|
+
|
|
5677
|
+// var right = left.cloneNode(true);
|
|
5678
|
+// right.style.paddingLeft = '8px';
|
|
5679
|
+
|
|
5680
|
+// // Sketch
|
|
5681
|
+// if (urlParams['sketch'] != '1')
|
|
5682
|
+// {
|
|
5683
|
+// opts.style.paddingBottom = '12px';
|
|
5684
|
+// row.appendChild(left);
|
|
5685
|
+
|
|
5686
|
+// left.appendChild(this.createOption(mxResources.get('sketch'), function()
|
|
5687
|
+// {
|
|
5688
|
+// return sketch;
|
|
5689
|
+// }, function(checked)
|
|
5690
|
+// {
|
|
5691
|
+// sketch = checked;
|
5638
|
5692
|
|
5639
|
|
- if (checked)
|
5640
|
|
- {
|
5641
|
|
- graph.currentEdgeStyle['sketch'] = '1';
|
5642
|
|
- graph.currentVertexStyle['sketch'] = '1';
|
5643
|
|
- }
|
5644
|
|
- else
|
5645
|
|
- {
|
5646
|
|
- delete graph.currentEdgeStyle['sketch'];
|
5647
|
|
- delete graph.currentVertexStyle['sketch'];
|
5648
|
|
- }
|
|
5693
|
+// if (checked)
|
|
5694
|
+// {
|
|
5695
|
+// graph.currentEdgeStyle['sketch'] = '1';
|
|
5696
|
+// graph.currentVertexStyle['sketch'] = '1';
|
|
5697
|
+// }
|
|
5698
|
+// else
|
|
5699
|
+// {
|
|
5700
|
+// delete graph.currentEdgeStyle['sketch'];
|
|
5701
|
+// delete graph.currentVertexStyle['sketch'];
|
|
5702
|
+// }
|
5649
|
5703
|
|
5650
|
|
- graph.updateCellStyles({'sketch': (checked) ? '1' : null}, graph.getVerticesAndEdges());
|
5651
|
|
- }, null, function(div)
|
5652
|
|
- {
|
5653
|
|
- div.style.width = 'auto';
|
5654
|
|
- }));
|
5655
|
|
- }
|
5656
|
|
-
|
5657
|
|
- row.appendChild(right);
|
5658
|
|
- tbody.appendChild(row);
|
5659
|
|
- table.appendChild(tbody);
|
5660
|
|
-
|
5661
|
|
- // Rounded
|
5662
|
|
- right.appendChild(this.createOption(mxResources.get('rounded'), function()
|
5663
|
|
- {
|
5664
|
|
- return rounded;
|
5665
|
|
- }, function(checked)
|
5666
|
|
- {
|
5667
|
|
- rounded = checked;
|
5668
|
|
-
|
5669
|
|
- if (checked)
|
5670
|
|
- {
|
5671
|
|
- graph.currentEdgeStyle['rounded'] = '1';
|
5672
|
|
- graph.currentVertexStyle['rounded'] = '1';
|
5673
|
|
- }
|
5674
|
|
- else
|
5675
|
|
- {
|
5676
|
|
- delete graph.currentEdgeStyle['rounded'];
|
5677
|
|
- delete graph.currentVertexStyle['rounded'];
|
5678
|
|
- }
|
5679
|
|
-
|
5680
|
|
- graph.updateCellStyles({'rounded': (checked) ? '1' : '0'}, graph.getVerticesAndEdges());
|
5681
|
|
- }, null, function(div)
|
5682
|
|
- {
|
5683
|
|
- div.style.width = 'auto';
|
5684
|
|
- }));
|
5685
|
|
-
|
5686
|
|
- // Curved
|
5687
|
|
- if (urlParams['sketch'] != '1')
|
5688
|
|
- {
|
5689
|
|
- left = left.cloneNode(false);
|
5690
|
|
- right = right.cloneNode(false);
|
5691
|
|
- row = row.cloneNode(false);
|
5692
|
|
- row.appendChild(left);
|
5693
|
|
- row.appendChild(right);
|
5694
|
|
- tbody.appendChild(row);
|
5695
|
|
-
|
5696
|
|
- left.appendChild(this.createOption(mxResources.get('curved'), function()
|
5697
|
|
- {
|
5698
|
|
- return curved;
|
5699
|
|
- }, function(checked)
|
5700
|
|
- {
|
5701
|
|
- curved = checked;
|
|
5704
|
+// graph.updateCellStyles({'sketch': (checked) ? '1' : null}, graph.getVerticesAndEdges());
|
|
5705
|
+// }, null, function(div)
|
|
5706
|
+// {
|
|
5707
|
+// div.style.width = 'auto';
|
|
5708
|
+// }));
|
|
5709
|
+// }
|
|
5710
|
+
|
|
5711
|
+// row.appendChild(right);
|
|
5712
|
+// tbody.appendChild(row);
|
|
5713
|
+// table.appendChild(tbody);
|
|
5714
|
+
|
|
5715
|
+// // Rounded
|
|
5716
|
+// right.appendChild(this.createOption(mxResources.get('rounded'), function()
|
|
5717
|
+// {
|
|
5718
|
+// return rounded;
|
|
5719
|
+// }, function(checked)
|
|
5720
|
+// {
|
|
5721
|
+// rounded = checked;
|
|
5722
|
+
|
|
5723
|
+// if (checked)
|
|
5724
|
+// {
|
|
5725
|
+// graph.currentEdgeStyle['rounded'] = '1';
|
|
5726
|
+// graph.currentVertexStyle['rounded'] = '1';
|
|
5727
|
+// }
|
|
5728
|
+// else
|
|
5729
|
+// {
|
|
5730
|
+// delete graph.currentEdgeStyle['rounded'];
|
|
5731
|
+// delete graph.currentVertexStyle['rounded'];
|
|
5732
|
+// }
|
|
5733
|
+
|
|
5734
|
+// graph.updateCellStyles({'rounded': (checked) ? '1' : '0'}, graph.getVerticesAndEdges());
|
|
5735
|
+// }, null, function(div)
|
|
5736
|
+// {
|
|
5737
|
+// div.style.width = 'auto';
|
|
5738
|
+// }));
|
|
5739
|
+
|
|
5740
|
+// // Curved
|
|
5741
|
+// if (urlParams['sketch'] != '1')
|
|
5742
|
+// {
|
|
5743
|
+// left = left.cloneNode(false);
|
|
5744
|
+// right = right.cloneNode(false);
|
|
5745
|
+// row = row.cloneNode(false);
|
|
5746
|
+// row.appendChild(left);
|
|
5747
|
+// row.appendChild(right);
|
|
5748
|
+// tbody.appendChild(row);
|
|
5749
|
+
|
|
5750
|
+// left.appendChild(this.createOption(mxResources.get('curved'), function()
|
|
5751
|
+// {
|
|
5752
|
+// return curved;
|
|
5753
|
+// }, function(checked)
|
|
5754
|
+// {
|
|
5755
|
+// curved = checked;
|
5702
|
5756
|
|
5703
|
|
- if (checked)
|
5704
|
|
- {
|
5705
|
|
- graph.currentEdgeStyle['curved'] = '1';
|
5706
|
|
- }
|
5707
|
|
- else
|
5708
|
|
- {
|
5709
|
|
- delete graph.currentEdgeStyle['curved'];
|
5710
|
|
- }
|
|
5757
|
+// if (checked)
|
|
5758
|
+// {
|
|
5759
|
+// graph.currentEdgeStyle['curved'] = '1';
|
|
5760
|
+// }
|
|
5761
|
+// else
|
|
5762
|
+// {
|
|
5763
|
+// delete graph.currentEdgeStyle['curved'];
|
|
5764
|
+// }
|
5711
|
5765
|
|
5712
|
|
- graph.updateCellStyles({'curved': (checked) ? '1' : null}, graph.getVerticesAndEdges(false, true));
|
5713
|
|
- }, null, function(div)
|
5714
|
|
- {
|
5715
|
|
- div.style.width = 'auto';
|
5716
|
|
- }));
|
5717
|
|
- }
|
5718
|
|
-
|
5719
|
|
- opts.appendChild(table);
|
5720
|
|
- div.appendChild(opts);
|
5721
|
|
-
|
5722
|
|
- var defaultStyles = ['fillColor', 'strokeColor', 'fontColor', 'gradientColor'];
|
5723
|
|
-
|
5724
|
|
- var updateCells = mxUtils.bind(this, function(styles, graphStyle)
|
5725
|
|
- {
|
5726
|
|
- var cells = graph.getVerticesAndEdges();
|
5727
|
|
-
|
5728
|
|
- model.beginUpdate();
|
5729
|
|
- try
|
5730
|
|
- {
|
5731
|
|
- for (var i = 0; i < cells.length; i++)
|
5732
|
|
- {
|
5733
|
|
- var style = graph.getCellStyle(cells[i]);
|
|
5766
|
+// graph.updateCellStyles({'curved': (checked) ? '1' : null}, graph.getVerticesAndEdges(false, true));
|
|
5767
|
+// }, null, function(div)
|
|
5768
|
+// {
|
|
5769
|
+// div.style.width = 'auto';
|
|
5770
|
+// }));
|
|
5771
|
+// }
|
|
5772
|
+
|
|
5773
|
+// opts.appendChild(table);
|
|
5774
|
+// div.appendChild(opts);
|
|
5775
|
+
|
|
5776
|
+// var defaultStyles = ['fillColor', 'strokeColor', 'fontColor', 'gradientColor'];
|
|
5777
|
+
|
|
5778
|
+// var updateCells = mxUtils.bind(this, function(styles, graphStyle)
|
|
5779
|
+// {
|
|
5780
|
+// var cells = graph.getVerticesAndEdges();
|
|
5781
|
+
|
|
5782
|
+// model.beginUpdate();
|
|
5783
|
+// try
|
|
5784
|
+// {
|
|
5785
|
+// for (var i = 0; i < cells.length; i++)
|
|
5786
|
+// {
|
|
5787
|
+// var style = graph.getCellStyle(cells[i]);
|
5734
|
5788
|
|
5735
|
|
- // Handles special label background color
|
5736
|
|
- if (style['labelBackgroundColor'] != null)
|
5737
|
|
- {
|
5738
|
|
- graph.updateCellStyles({'labelBackgroundColor': (graphStyle != null) ?
|
5739
|
|
- graphStyle.background : null}, [cells[i]]);
|
5740
|
|
- }
|
|
5789
|
+// // Handles special label background color
|
|
5790
|
+// if (style['labelBackgroundColor'] != null)
|
|
5791
|
+// {
|
|
5792
|
+// graph.updateCellStyles({'labelBackgroundColor': (graphStyle != null) ?
|
|
5793
|
+// graphStyle.background : null}, [cells[i]]);
|
|
5794
|
+// }
|
5741
|
5795
|
|
5742
|
|
- var edge = model.isEdge(cells[i]);
|
5743
|
|
- var newStyle = model.getStyle(cells[i]);
|
5744
|
|
- var current = (edge) ? graph.currentEdgeStyle : graph.currentVertexStyle;
|
5745
|
|
-
|
5746
|
|
- for (var j = 0; j < styles.length; j++)
|
5747
|
|
- {
|
5748
|
|
- if ((style[styles[j]] != null && style[styles[j]] != mxConstants.NONE) ||
|
5749
|
|
- (styles[j] != mxConstants.STYLE_FILLCOLOR &&
|
5750
|
|
- styles[j] != mxConstants.STYLE_STROKECOLOR))
|
5751
|
|
- {
|
5752
|
|
- newStyle = mxUtils.setStyle(newStyle, styles[j], current[styles[j]]);
|
5753
|
|
- }
|
5754
|
|
- }
|
|
5796
|
+// var edge = model.isEdge(cells[i]);
|
|
5797
|
+// var newStyle = model.getStyle(cells[i]);
|
|
5798
|
+// var current = (edge) ? graph.currentEdgeStyle : graph.currentVertexStyle;
|
|
5799
|
+
|
|
5800
|
+// for (var j = 0; j < styles.length; j++)
|
|
5801
|
+// {
|
|
5802
|
+// if ((style[styles[j]] != null && style[styles[j]] != mxConstants.NONE) ||
|
|
5803
|
+// (styles[j] != mxConstants.STYLE_FILLCOLOR &&
|
|
5804
|
+// styles[j] != mxConstants.STYLE_STROKECOLOR))
|
|
5805
|
+// {
|
|
5806
|
+// newStyle = mxUtils.setStyle(newStyle, styles[j], current[styles[j]]);
|
|
5807
|
+// }
|
|
5808
|
+// }
|
5755
|
5809
|
|
5756
|
|
- model.setStyle(cells[i], newStyle);
|
5757
|
|
- }
|
5758
|
|
- }
|
5759
|
|
- finally
|
5760
|
|
- {
|
5761
|
|
- model.endUpdate();
|
5762
|
|
- }
|
5763
|
|
- });
|
|
5810
|
+// model.setStyle(cells[i], newStyle);
|
|
5811
|
+// }
|
|
5812
|
+// }
|
|
5813
|
+// finally
|
|
5814
|
+// {
|
|
5815
|
+// model.endUpdate();
|
|
5816
|
+// }
|
|
5817
|
+// });
|
5764
|
5818
|
|
5765
|
|
- var removeStyles = mxUtils.bind(this, function(style, styles, defaultStyle)
|
5766
|
|
- {
|
5767
|
|
- if (style != null)
|
5768
|
|
- {
|
5769
|
|
- for (var j = 0; j < styles.length; j++)
|
5770
|
|
- {
|
5771
|
|
- if (((style[styles[j]] != null &&
|
5772
|
|
- style[styles[j]] != mxConstants.NONE) ||
|
5773
|
|
- (styles[j] != mxConstants.STYLE_FILLCOLOR &&
|
5774
|
|
- styles[j] != mxConstants.STYLE_STROKECOLOR)))
|
5775
|
|
- {
|
5776
|
|
- style[styles[j]] = defaultStyle[styles[j]];
|
5777
|
|
- }
|
5778
|
|
- }
|
5779
|
|
- }
|
5780
|
|
- });
|
5781
|
|
-
|
5782
|
|
- var applyStyle = mxUtils.bind(this, function(style, result, cell, graphStyle, theGraph)
|
5783
|
|
- {
|
5784
|
|
- if (style != null)
|
5785
|
|
- {
|
5786
|
|
- if (cell != null)
|
5787
|
|
- {
|
5788
|
|
- // Handles special label background color
|
5789
|
|
- if (result['labelBackgroundColor'] != null)
|
5790
|
|
- {
|
5791
|
|
- var bg = (graphStyle != null) ? graphStyle.background : null;
|
5792
|
|
- theGraph = (theGraph != null) ? theGraph : graph;
|
|
5819
|
+// var removeStyles = mxUtils.bind(this, function(style, styles, defaultStyle)
|
|
5820
|
+// {
|
|
5821
|
+// if (style != null)
|
|
5822
|
+// {
|
|
5823
|
+// for (var j = 0; j < styles.length; j++)
|
|
5824
|
+// {
|
|
5825
|
+// if (((style[styles[j]] != null &&
|
|
5826
|
+// style[styles[j]] != mxConstants.NONE) ||
|
|
5827
|
+// (styles[j] != mxConstants.STYLE_FILLCOLOR &&
|
|
5828
|
+// styles[j] != mxConstants.STYLE_STROKECOLOR)))
|
|
5829
|
+// {
|
|
5830
|
+// style[styles[j]] = defaultStyle[styles[j]];
|
|
5831
|
+// }
|
|
5832
|
+// }
|
|
5833
|
+// }
|
|
5834
|
+// });
|
|
5835
|
+
|
|
5836
|
+// var applyStyle = mxUtils.bind(this, function(style, result, cell, graphStyle, theGraph)
|
|
5837
|
+// {
|
|
5838
|
+// if (style != null)
|
|
5839
|
+// {
|
|
5840
|
+// if (cell != null)
|
|
5841
|
+// {
|
|
5842
|
+// // Handles special label background color
|
|
5843
|
+// if (result['labelBackgroundColor'] != null)
|
|
5844
|
+// {
|
|
5845
|
+// var bg = (graphStyle != null) ? graphStyle.background : null;
|
|
5846
|
+// theGraph = (theGraph != null) ? theGraph : graph;
|
5793
|
5847
|
|
5794
|
|
- if (bg == null)
|
5795
|
|
- {
|
5796
|
|
- bg = theGraph.background;
|
5797
|
|
- }
|
|
5848
|
+// if (bg == null)
|
|
5849
|
+// {
|
|
5850
|
+// bg = theGraph.background;
|
|
5851
|
+// }
|
5798
|
5852
|
|
5799
|
|
- if (bg == null)
|
5800
|
|
- {
|
5801
|
|
- bg = theGraph.defaultPageBackgroundColor;
|
5802
|
|
- }
|
|
5853
|
+// if (bg == null)
|
|
5854
|
+// {
|
|
5855
|
+// bg = theGraph.defaultPageBackgroundColor;
|
|
5856
|
+// }
|
5803
|
5857
|
|
5804
|
|
- result['labelBackgroundColor'] = bg;
|
5805
|
|
- }
|
5806
|
|
- }
|
|
5858
|
+// result['labelBackgroundColor'] = bg;
|
|
5859
|
+// }
|
|
5860
|
+// }
|
5807
|
5861
|
|
5808
|
|
- for (var key in style)
|
5809
|
|
- {
|
5810
|
|
- if (cell == null || ((result[key] != null &&
|
5811
|
|
- result[key] != mxConstants.NONE) ||
|
5812
|
|
- (key != mxConstants.STYLE_FILLCOLOR &&
|
5813
|
|
- key != mxConstants.STYLE_STROKECOLOR)))
|
5814
|
|
- {
|
5815
|
|
- result[key] = style[key];
|
5816
|
|
- }
|
5817
|
|
- }
|
5818
|
|
- }
|
5819
|
|
- });
|
5820
|
|
-
|
5821
|
|
- if (urlParams['sketch'] != '1')
|
5822
|
|
- {
|
5823
|
|
- var btn = mxUtils.button(mxResources.get('reset'), mxUtils.bind(this, function(evt)
|
5824
|
|
- {
|
5825
|
|
- var all = graph.getVerticesAndEdges(true, true);
|
|
5862
|
+// for (var key in style)
|
|
5863
|
+// {
|
|
5864
|
+// if (cell == null || ((result[key] != null &&
|
|
5865
|
+// result[key] != mxConstants.NONE) ||
|
|
5866
|
+// (key != mxConstants.STYLE_FILLCOLOR &&
|
|
5867
|
+// key != mxConstants.STYLE_STROKECOLOR)))
|
|
5868
|
+// {
|
|
5869
|
+// result[key] = style[key];
|
|
5870
|
+// }
|
|
5871
|
+// }
|
|
5872
|
+// }
|
|
5873
|
+// });
|
|
5874
|
+
|
|
5875
|
+// if (urlParams['sketch'] != '1')
|
|
5876
|
+// {
|
|
5877
|
+// var btn = mxUtils.button(mxResources.get('reset'), mxUtils.bind(this, function(evt)
|
|
5878
|
+// {
|
|
5879
|
+// var all = graph.getVerticesAndEdges(true, true);
|
5826
|
5880
|
|
5827
|
|
- if (all.length > 0)
|
5828
|
|
- {
|
5829
|
|
- model.beginUpdate();
|
5830
|
|
- try
|
5831
|
|
- {
|
5832
|
|
- graph.updateCellStyles({'sketch': null, 'rounded': null}, all);
|
5833
|
|
- graph.updateCellStyles({'curved': null}, graph.getVerticesAndEdges(false, true));
|
5834
|
|
- }
|
5835
|
|
- finally
|
5836
|
|
- {
|
5837
|
|
- model.endUpdate();
|
5838
|
|
- }
|
5839
|
|
- }
|
|
5881
|
+// if (all.length > 0)
|
|
5882
|
+// {
|
|
5883
|
+// model.beginUpdate();
|
|
5884
|
+// try
|
|
5885
|
+// {
|
|
5886
|
+// graph.updateCellStyles({'sketch': null, 'rounded': null}, all);
|
|
5887
|
+// graph.updateCellStyles({'curved': null}, graph.getVerticesAndEdges(false, true));
|
|
5888
|
+// }
|
|
5889
|
+// finally
|
|
5890
|
+// {
|
|
5891
|
+// model.endUpdate();
|
|
5892
|
+// }
|
|
5893
|
+// }
|
5840
|
5894
|
|
5841
|
|
- ui.clearDefaultStyle();
|
5842
|
|
- }));
|
5843
|
|
-
|
5844
|
|
- btn.setAttribute('title', mxResources.get('reset'));
|
5845
|
|
- btn.style.textOverflow = 'ellipsis';
|
5846
|
|
- btn.style.maxWidth = '90px';
|
5847
|
|
- right.appendChild(btn);
|
5848
|
|
- }
|
5849
|
|
-
|
5850
|
|
- var createPreview = mxUtils.bind(this, function(commonStyle, vertexStyle, edgeStyle, graphStyle, container)
|
5851
|
|
- {
|
5852
|
|
- // Wrapper needed to catch events
|
5853
|
|
- var div = document.createElement('div');
|
5854
|
|
- div.style.position = 'absolute';
|
5855
|
|
- div.style.display = 'inline-block';
|
5856
|
|
- div.style.overflow = 'hidden';
|
5857
|
|
- div.style.pointerEvents = 'none';
|
5858
|
|
- div.style.width = '100%';
|
5859
|
|
- div.style.height = '100%';
|
5860
|
|
- container.appendChild(div);
|
5861
|
|
-
|
5862
|
|
- var graph2 = new Graph(div, null, null, graph.getStylesheet());
|
5863
|
|
-
|
5864
|
|
- graph2.resetViewOnRootChange = false;
|
5865
|
|
- graph2.foldingEnabled = false;
|
5866
|
|
- graph2.gridEnabled = false;
|
5867
|
|
- graph2.autoScroll = false;
|
5868
|
|
- graph2.setTooltips(false);
|
5869
|
|
- graph2.setConnectable(false);
|
5870
|
|
- graph2.setPanning(false);
|
5871
|
|
- graph2.setEnabled(false);
|
5872
|
|
-
|
5873
|
|
- graph2.getCellStyle = function(cell, resolve)
|
5874
|
|
- {
|
5875
|
|
- resolve = (resolve != null) ? resolve : true;
|
5876
|
|
- var result = mxUtils.clone(graph.getCellStyle.apply(this, arguments));
|
5877
|
|
- var defaultStyle = graph.stylesheet.getDefaultVertexStyle();
|
5878
|
|
- var appliedStyle = vertexStyle;
|
|
5895
|
+// ui.clearDefaultStyle();
|
|
5896
|
+// }));
|
|
5897
|
+
|
|
5898
|
+// btn.setAttribute('title', mxResources.get('reset'));
|
|
5899
|
+// btn.style.textOverflow = 'ellipsis';
|
|
5900
|
+// btn.style.maxWidth = '90px';
|
|
5901
|
+// right.appendChild(btn);
|
|
5902
|
+// }
|
|
5903
|
+
|
|
5904
|
+// var createPreview = mxUtils.bind(this, function(commonStyle, vertexStyle, edgeStyle, graphStyle, container)
|
|
5905
|
+// {
|
|
5906
|
+// // Wrapper needed to catch events
|
|
5907
|
+// var div = document.createElement('div');
|
|
5908
|
+// div.style.position = 'absolute';
|
|
5909
|
+// div.style.display = 'inline-block';
|
|
5910
|
+// div.style.overflow = 'hidden';
|
|
5911
|
+// div.style.pointerEvents = 'none';
|
|
5912
|
+// div.style.width = '100%';
|
|
5913
|
+// div.style.height = '100%';
|
|
5914
|
+// container.appendChild(div);
|
|
5915
|
+
|
|
5916
|
+// var graph2 = new Graph(div, null, null, graph.getStylesheet());
|
|
5917
|
+
|
|
5918
|
+// graph2.resetViewOnRootChange = false;
|
|
5919
|
+// graph2.foldingEnabled = false;
|
|
5920
|
+// graph2.gridEnabled = false;
|
|
5921
|
+// graph2.autoScroll = false;
|
|
5922
|
+// graph2.setTooltips(false);
|
|
5923
|
+// graph2.setConnectable(false);
|
|
5924
|
+// graph2.setPanning(false);
|
|
5925
|
+// graph2.setEnabled(false);
|
|
5926
|
+
|
|
5927
|
+// graph2.getCellStyle = function(cell, resolve)
|
|
5928
|
+// {
|
|
5929
|
+// resolve = (resolve != null) ? resolve : true;
|
|
5930
|
+// var result = mxUtils.clone(graph.getCellStyle.apply(this, arguments));
|
|
5931
|
+// var defaultStyle = graph.stylesheet.getDefaultVertexStyle();
|
|
5932
|
+// var appliedStyle = vertexStyle;
|
5879
|
5933
|
|
5880
|
|
- if (model.isEdge(cell))
|
5881
|
|
- {
|
5882
|
|
- defaultStyle = graph.stylesheet.getDefaultEdgeStyle();
|
5883
|
|
- appliedStyle = edgeStyle;
|
5884
|
|
- }
|
|
5934
|
+// if (model.isEdge(cell))
|
|
5935
|
+// {
|
|
5936
|
+// defaultStyle = graph.stylesheet.getDefaultEdgeStyle();
|
|
5937
|
+// appliedStyle = edgeStyle;
|
|
5938
|
+// }
|
5885
|
5939
|
|
5886
|
|
- removeStyles(result, defaultStyles, defaultStyle);
|
5887
|
|
- applyStyle(commonStyle, result, cell, graphStyle, graph2);
|
5888
|
|
- applyStyle(appliedStyle, result, cell, graphStyle, graph2);
|
|
5940
|
+// removeStyles(result, defaultStyles, defaultStyle);
|
|
5941
|
+// applyStyle(commonStyle, result, cell, graphStyle, graph2);
|
|
5942
|
+// applyStyle(appliedStyle, result, cell, graphStyle, graph2);
|
5889
|
5943
|
|
5890
|
|
- if (resolve)
|
5891
|
|
- {
|
5892
|
|
- result = graph.postProcessCellStyle(cell, result);
|
5893
|
|
- }
|
5894
|
|
-
|
5895
|
|
- return result;
|
5896
|
|
- };
|
5897
|
|
-
|
5898
|
|
- // Avoid HTML labels to capture events in bubble phase
|
5899
|
|
- graph2.model.beginUpdate();
|
5900
|
|
- try
|
5901
|
|
- {
|
5902
|
|
- var v1 = graph2.insertVertex(graph2.getDefaultParent(), null, 'Shape', 14, 8, 70, 40, 'strokeWidth=2;');
|
5903
|
|
- var e1 = graph2.insertEdge(graph2.getDefaultParent(), null, 'Connector', v1, v1,
|
5904
|
|
- 'edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;endSize=5;strokeWidth=2;')
|
5905
|
|
- e1.geometry.points = [new mxPoint(32, 70)];
|
5906
|
|
- e1.geometry.offset = new mxPoint(0, 8);
|
5907
|
|
- }
|
5908
|
|
- finally
|
5909
|
|
- {
|
5910
|
|
- graph2.model.endUpdate();
|
5911
|
|
- }
|
5912
|
|
- });
|
5913
|
|
-
|
5914
|
|
- // Entries
|
5915
|
|
- var entries = document.createElement('div');
|
5916
|
|
- entries.style.position = 'relative';
|
5917
|
|
- div.appendChild(entries);
|
5918
|
|
-
|
5919
|
|
- // Cached entries
|
5920
|
|
- if (this.format.cachedStyleEntries == null)
|
5921
|
|
- {
|
5922
|
|
- this.format.cachedStyleEntries = [];
|
5923
|
|
- }
|
5924
|
|
-
|
5925
|
|
- function addKeys(style, result)
|
5926
|
|
- {
|
5927
|
|
- for (var key in style)
|
5928
|
|
- {
|
5929
|
|
- result.push(key);
|
5930
|
|
- }
|
5931
|
|
-
|
5932
|
|
- return result;
|
5933
|
|
- };
|
5934
|
|
-
|
5935
|
|
- var addEntry = mxUtils.bind(this, function(commonStyle, vertexStyle, edgeStyle, graphStyle, index)
|
5936
|
|
- {
|
5937
|
|
- var panel = this.format.cachedStyleEntries[index];
|
5938
|
|
-
|
5939
|
|
- if (panel == null)
|
5940
|
|
- {
|
5941
|
|
- panel = document.createElement('div');
|
5942
|
|
- panel.style.display = 'inline-block';
|
5943
|
|
- panel.style.position = 'relative';
|
5944
|
|
- panel.style.width = '96px';
|
5945
|
|
- panel.style.height = '90px';
|
5946
|
|
- panel.style.cursor = 'pointer';
|
5947
|
|
- panel.style.border = '1px solid gray';
|
5948
|
|
- panel.style.borderRadius = '8px';
|
5949
|
|
- panel.style.margin = '2px';
|
5950
|
|
- panel.style.overflow = 'hidden';
|
5951
|
|
-
|
5952
|
|
- if (graphStyle != null && graphStyle.background != null)
|
5953
|
|
- {
|
5954
|
|
- panel.style.backgroundColor = graphStyle.background;
|
5955
|
|
- }
|
|
5944
|
+// if (resolve)
|
|
5945
|
+// {
|
|
5946
|
+// result = graph.postProcessCellStyle(cell, result);
|
|
5947
|
+// }
|
|
5948
|
+
|
|
5949
|
+// return result;
|
|
5950
|
+// };
|
|
5951
|
+
|
|
5952
|
+// // Avoid HTML labels to capture events in bubble phase
|
|
5953
|
+// graph2.model.beginUpdate();
|
|
5954
|
+// try
|
|
5955
|
+// {
|
|
5956
|
+// var v1 = graph2.insertVertex(graph2.getDefaultParent(), null, 'Shape', 14, 8, 70, 40, 'strokeWidth=2;');
|
|
5957
|
+// var e1 = graph2.insertEdge(graph2.getDefaultParent(), null, 'Connector', v1, v1,
|
|
5958
|
+// 'edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;endSize=5;strokeWidth=2;')
|
|
5959
|
+// e1.geometry.points = [new mxPoint(32, 70)];
|
|
5960
|
+// e1.geometry.offset = new mxPoint(0, 8);
|
|
5961
|
+// }
|
|
5962
|
+// finally
|
|
5963
|
+// {
|
|
5964
|
+// graph2.model.endUpdate();
|
|
5965
|
+// }
|
|
5966
|
+// });
|
|
5967
|
+
|
|
5968
|
+// // Entries
|
|
5969
|
+// var entries = document.createElement('div');
|
|
5970
|
+// entries.style.position = 'relative';
|
|
5971
|
+// div.appendChild(entries);
|
|
5972
|
+
|
|
5973
|
+// // Cached entries
|
|
5974
|
+// if (this.format.cachedStyleEntries == null)
|
|
5975
|
+// {
|
|
5976
|
+// this.format.cachedStyleEntries = [];
|
|
5977
|
+// }
|
|
5978
|
+
|
|
5979
|
+// function addKeys(style, result)
|
|
5980
|
+// {
|
|
5981
|
+// for (var key in style)
|
|
5982
|
+// {
|
|
5983
|
+// result.push(key);
|
|
5984
|
+// }
|
|
5985
|
+
|
|
5986
|
+// return result;
|
|
5987
|
+// };
|
|
5988
|
+
|
|
5989
|
+// var addEntry = mxUtils.bind(this, function(commonStyle, vertexStyle, edgeStyle, graphStyle, index)
|
|
5990
|
+// {
|
|
5991
|
+// var panel = this.format.cachedStyleEntries[index];
|
|
5992
|
+
|
|
5993
|
+// if (panel == null)
|
|
5994
|
+// {
|
|
5995
|
+// panel = document.createElement('div');
|
|
5996
|
+// panel.style.display = 'inline-block';
|
|
5997
|
+// panel.style.position = 'relative';
|
|
5998
|
+// panel.style.width = '96px';
|
|
5999
|
+// panel.style.height = '90px';
|
|
6000
|
+// panel.style.cursor = 'pointer';
|
|
6001
|
+// panel.style.border = '1px solid gray';
|
|
6002
|
+// panel.style.borderRadius = '8px';
|
|
6003
|
+// panel.style.margin = '2px';
|
|
6004
|
+// panel.style.overflow = 'hidden';
|
|
6005
|
+
|
|
6006
|
+// if (graphStyle != null && graphStyle.background != null)
|
|
6007
|
+// {
|
|
6008
|
+// panel.style.backgroundColor = graphStyle.background;
|
|
6009
|
+// }
|
5956
|
6010
|
|
5957
|
|
- createPreview(commonStyle, vertexStyle, edgeStyle, graphStyle, panel);
|
5958
|
|
-
|
5959
|
|
- mxEvent.addGestureListeners(panel, mxUtils.bind(this, function(evt)
|
5960
|
|
- {
|
5961
|
|
- panel.style.opacity = 0.5;
|
5962
|
|
- }), null, mxUtils.bind(this, function(evt)
|
5963
|
|
- {
|
5964
|
|
- panel.style.opacity = 1;
|
5965
|
|
- graph.currentVertexStyle = mxUtils.clone(graph.defaultVertexStyle);
|
5966
|
|
- graph.currentEdgeStyle = mxUtils.clone(graph.defaultEdgeStyle);
|
|
6011
|
+// createPreview(commonStyle, vertexStyle, edgeStyle, graphStyle, panel);
|
|
6012
|
+
|
|
6013
|
+// mxEvent.addGestureListeners(panel, mxUtils.bind(this, function(evt)
|
|
6014
|
+// {
|
|
6015
|
+// panel.style.opacity = 0.5;
|
|
6016
|
+// }), null, mxUtils.bind(this, function(evt)
|
|
6017
|
+// {
|
|
6018
|
+// panel.style.opacity = 1;
|
|
6019
|
+// graph.currentVertexStyle = mxUtils.clone(graph.defaultVertexStyle);
|
|
6020
|
+// graph.currentEdgeStyle = mxUtils.clone(graph.defaultEdgeStyle);
|
5967
|
6021
|
|
5968
|
|
- applyStyle(commonStyle, graph.currentVertexStyle);
|
5969
|
|
- applyStyle(commonStyle, graph.currentEdgeStyle);
|
5970
|
|
- applyStyle(vertexStyle, graph.currentVertexStyle);
|
5971
|
|
- applyStyle(edgeStyle, graph.currentEdgeStyle);
|
5972
|
|
-
|
5973
|
|
- if (urlParams['sketch'] == '1')
|
5974
|
|
- {
|
5975
|
|
- sketch = Editor.sketchMode;
|
5976
|
|
- }
|
|
6022
|
+// applyStyle(commonStyle, graph.currentVertexStyle);
|
|
6023
|
+// applyStyle(commonStyle, graph.currentEdgeStyle);
|
|
6024
|
+// applyStyle(vertexStyle, graph.currentVertexStyle);
|
|
6025
|
+// applyStyle(edgeStyle, graph.currentEdgeStyle);
|
|
6026
|
+
|
|
6027
|
+// if (urlParams['sketch'] == '1')
|
|
6028
|
+// {
|
|
6029
|
+// sketch = Editor.sketchMode;
|
|
6030
|
+// }
|
5977
|
6031
|
|
5978
|
|
- if (sketch)
|
5979
|
|
- {
|
5980
|
|
- graph.currentEdgeStyle['sketch'] = '1';
|
5981
|
|
- graph.currentVertexStyle['sketch'] = '1';
|
5982
|
|
- }
|
5983
|
|
- else
|
5984
|
|
- {
|
5985
|
|
- graph.currentEdgeStyle['sketch'] = '0';
|
5986
|
|
- graph.currentVertexStyle['sketch'] = '0';
|
5987
|
|
- }
|
|
6032
|
+// if (sketch)
|
|
6033
|
+// {
|
|
6034
|
+// graph.currentEdgeStyle['sketch'] = '1';
|
|
6035
|
+// graph.currentVertexStyle['sketch'] = '1';
|
|
6036
|
+// }
|
|
6037
|
+// else
|
|
6038
|
+// {
|
|
6039
|
+// graph.currentEdgeStyle['sketch'] = '0';
|
|
6040
|
+// graph.currentVertexStyle['sketch'] = '0';
|
|
6041
|
+// }
|
5988
|
6042
|
|
5989
|
|
- if (rounded)
|
5990
|
|
- {
|
5991
|
|
- graph.currentVertexStyle['rounded'] = '1';
|
5992
|
|
- graph.currentEdgeStyle['rounded'] = '1';
|
5993
|
|
- }
|
5994
|
|
- else
|
5995
|
|
- {
|
5996
|
|
- graph.currentVertexStyle['rounded'] = '0';
|
5997
|
|
- graph.currentEdgeStyle['rounded'] = '1';
|
5998
|
|
- }
|
|
6043
|
+// if (rounded)
|
|
6044
|
+// {
|
|
6045
|
+// graph.currentVertexStyle['rounded'] = '1';
|
|
6046
|
+// graph.currentEdgeStyle['rounded'] = '1';
|
|
6047
|
+// }
|
|
6048
|
+// else
|
|
6049
|
+// {
|
|
6050
|
+// graph.currentVertexStyle['rounded'] = '0';
|
|
6051
|
+// graph.currentEdgeStyle['rounded'] = '1';
|
|
6052
|
+// }
|
5999
|
6053
|
|
6000
|
|
- if (curved)
|
6001
|
|
- {
|
6002
|
|
- graph.currentEdgeStyle['curved'] = '1';
|
6003
|
|
- }
|
6004
|
|
- else
|
6005
|
|
- {
|
6006
|
|
- graph.currentEdgeStyle['curved'] = '0';
|
6007
|
|
- }
|
6008
|
|
-
|
6009
|
|
- model.beginUpdate();
|
6010
|
|
- try
|
6011
|
|
- {
|
6012
|
|
- updateCells(addKeys(commonStyle, defaultStyles.slice()), graphStyle);
|
|
6054
|
+// if (curved)
|
|
6055
|
+// {
|
|
6056
|
+// graph.currentEdgeStyle['curved'] = '1';
|
|
6057
|
+// }
|
|
6058
|
+// else
|
|
6059
|
+// {
|
|
6060
|
+// graph.currentEdgeStyle['curved'] = '0';
|
|
6061
|
+// }
|
|
6062
|
+
|
|
6063
|
+// model.beginUpdate();
|
|
6064
|
+// try
|
|
6065
|
+// {
|
|
6066
|
+// updateCells(addKeys(commonStyle, defaultStyles.slice()), graphStyle);
|
6013
|
6067
|
|
6014
|
|
- var change = new ChangePageSetup(ui, (graphStyle != null) ? graphStyle.background : null);
|
6015
|
|
- change.ignoreImage = true;
|
6016
|
|
- model.execute(change);
|
|
6068
|
+// var change = new ChangePageSetup(ui, (graphStyle != null) ? graphStyle.background : null);
|
|
6069
|
+// change.ignoreImage = true;
|
|
6070
|
+// model.execute(change);
|
6017
|
6071
|
|
6018
|
|
- model.execute(new ChangeGridColor(ui,
|
6019
|
|
- (graphStyle != null && graphStyle.gridColor != null) ?
|
6020
|
|
- graphStyle.gridColor : gridColor));
|
6021
|
|
- }
|
6022
|
|
- finally
|
6023
|
|
- {
|
6024
|
|
- model.endUpdate();
|
6025
|
|
- }
|
6026
|
|
- }));
|
|
6072
|
+// model.execute(new ChangeGridColor(ui,
|
|
6073
|
+// (graphStyle != null && graphStyle.gridColor != null) ?
|
|
6074
|
+// graphStyle.gridColor : gridColor));
|
|
6075
|
+// }
|
|
6076
|
+// finally
|
|
6077
|
+// {
|
|
6078
|
+// model.endUpdate();
|
|
6079
|
+// }
|
|
6080
|
+// }));
|
6027
|
6081
|
|
6028
|
|
- mxEvent.addListener(panel, 'mouseenter', mxUtils.bind(this, function(evt)
|
6029
|
|
- {
|
6030
|
|
- var prev = graph.getCellStyle;
|
6031
|
|
- var prevBg = graph.background;
|
6032
|
|
- var prevGrid = graph.view.gridColor;
|
6033
|
|
-
|
6034
|
|
- graph.background = (graphStyle != null) ? graphStyle.background : null;
|
6035
|
|
- graph.view.gridColor = (graphStyle != null && graphStyle.gridColor != null) ?
|
6036
|
|
- graphStyle.gridColor : gridColor;
|
|
6082
|
+// mxEvent.addListener(panel, 'mouseenter', mxUtils.bind(this, function(evt)
|
|
6083
|
+// {
|
|
6084
|
+// var prev = graph.getCellStyle;
|
|
6085
|
+// var prevBg = graph.background;
|
|
6086
|
+// var prevGrid = graph.view.gridColor;
|
|
6087
|
+
|
|
6088
|
+// graph.background = (graphStyle != null) ? graphStyle.background : null;
|
|
6089
|
+// graph.view.gridColor = (graphStyle != null && graphStyle.gridColor != null) ?
|
|
6090
|
+// graphStyle.gridColor : gridColor;
|
6037
|
6091
|
|
6038
|
|
- graph.getCellStyle = function(cell, resolve)
|
6039
|
|
- {
|
6040
|
|
- resolve = (resolve != null) ? resolve : true;
|
6041
|
|
- var result = mxUtils.clone(prev.apply(this, arguments));
|
|
6092
|
+// graph.getCellStyle = function(cell, resolve)
|
|
6093
|
+// {
|
|
6094
|
+// resolve = (resolve != null) ? resolve : true;
|
|
6095
|
+// var result = mxUtils.clone(prev.apply(this, arguments));
|
6042
|
6096
|
|
6043
|
|
- var defaultStyle = graph.stylesheet.getDefaultVertexStyle();
|
6044
|
|
- var appliedStyle = vertexStyle;
|
|
6097
|
+// var defaultStyle = graph.stylesheet.getDefaultVertexStyle();
|
|
6098
|
+// var appliedStyle = vertexStyle;
|
6045
|
6099
|
|
6046
|
|
- if (model.isEdge(cell))
|
6047
|
|
- {
|
6048
|
|
- defaultStyle = graph.stylesheet.getDefaultEdgeStyle();
|
6049
|
|
- appliedStyle = edgeStyle;
|
6050
|
|
- }
|
|
6100
|
+// if (model.isEdge(cell))
|
|
6101
|
+// {
|
|
6102
|
+// defaultStyle = graph.stylesheet.getDefaultEdgeStyle();
|
|
6103
|
+// appliedStyle = edgeStyle;
|
|
6104
|
+// }
|
6051
|
6105
|
|
6052
|
|
- removeStyles(result, defaultStyles, defaultStyle);
|
6053
|
|
- applyStyle(commonStyle, result, cell, graphStyle);
|
6054
|
|
- applyStyle(appliedStyle, result, cell, graphStyle);
|
|
6106
|
+// removeStyles(result, defaultStyles, defaultStyle);
|
|
6107
|
+// applyStyle(commonStyle, result, cell, graphStyle);
|
|
6108
|
+// applyStyle(appliedStyle, result, cell, graphStyle);
|
6055
|
6109
|
|
6056
|
|
- if (resolve)
|
6057
|
|
- {
|
6058
|
|
- result = this.postProcessCellStyle(cell, result);
|
6059
|
|
- }
|
|
6110
|
+// if (resolve)
|
|
6111
|
+// {
|
|
6112
|
+// result = this.postProcessCellStyle(cell, result);
|
|
6113
|
+// }
|
6060
|
6114
|
|
6061
|
|
- return result;
|
6062
|
|
- };
|
|
6115
|
+// return result;
|
|
6116
|
+// };
|
6063
|
6117
|
|
6064
|
|
- graph.refresh();
|
6065
|
|
- graph.getCellStyle = prev;
|
6066
|
|
- graph.background = prevBg;
|
6067
|
|
- graph.view.gridColor = prevGrid;
|
6068
|
|
- }));
|
|
6118
|
+// graph.refresh();
|
|
6119
|
+// graph.getCellStyle = prev;
|
|
6120
|
+// graph.background = prevBg;
|
|
6121
|
+// graph.view.gridColor = prevGrid;
|
|
6122
|
+// }));
|
6069
|
6123
|
|
6070
|
|
- mxEvent.addListener(panel, 'mouseleave', mxUtils.bind(this, function(evt)
|
6071
|
|
- {
|
6072
|
|
- graph.refresh();
|
6073
|
|
- }));
|
|
6124
|
+// mxEvent.addListener(panel, 'mouseleave', mxUtils.bind(this, function(evt)
|
|
6125
|
+// {
|
|
6126
|
+// graph.refresh();
|
|
6127
|
+// }));
|
6074
|
6128
|
|
6075
|
|
- // Workaround for broken cache in IE11
|
6076
|
|
- if (!mxClient.IS_IE && !mxClient.IS_IE11)
|
6077
|
|
- {
|
6078
|
|
- this.format.cachedStyleEntries[index] = panel;
|
6079
|
|
- }
|
6080
|
|
- }
|
6081
|
|
-
|
6082
|
|
- entries.appendChild(panel);
|
6083
|
|
- });
|
6084
|
|
-
|
6085
|
|
- // Maximum palettes to switch the switcher
|
6086
|
|
- var maxEntries = 10;
|
6087
|
|
- var pageCount = Math.ceil(Editor.styles.length / maxEntries);
|
6088
|
|
- this.format.currentStylePage = (this.format.currentStylePage != null) ? this.format.currentStylePage : 0;
|
6089
|
|
- var dots = [];
|
6090
|
|
-
|
6091
|
|
- var addEntries = mxUtils.bind(this, function()
|
6092
|
|
- {
|
6093
|
|
- if (dots.length > 0)
|
6094
|
|
- {
|
6095
|
|
- dots[this.format.currentStylePage].style.background = '#84d7ff';
|
6096
|
|
- }
|
6097
|
|
-
|
6098
|
|
- for (var i = this.format.currentStylePage * maxEntries;
|
6099
|
|
- i < Math.min((this.format.currentStylePage + 1) * maxEntries,
|
6100
|
|
- Editor.styles.length); i++)
|
6101
|
|
- {
|
6102
|
|
- var s = Editor.styles[i];
|
6103
|
|
- addEntry(s.commonStyle, s.vertexStyle, s.edgeStyle, s.graph, i);
|
6104
|
|
- }
|
6105
|
|
- });
|
6106
|
|
-
|
6107
|
|
- var selectPage = mxUtils.bind(this, function(index)
|
6108
|
|
- {
|
6109
|
|
- if (index >= 0 && index < pageCount)
|
6110
|
|
- {
|
6111
|
|
- dots[this.format.currentStylePage].style.background = 'transparent';
|
6112
|
|
- entries.innerHTML = '';
|
6113
|
|
- this.format.currentStylePage = index;
|
6114
|
|
- addEntries();
|
6115
|
|
- }
|
6116
|
|
- });
|
6117
|
|
-
|
6118
|
|
- if (pageCount > 1)
|
6119
|
|
- {
|
6120
|
|
- // Selector
|
6121
|
|
- var switcher = document.createElement('div');
|
6122
|
|
- switcher.style.whiteSpace = 'nowrap';
|
6123
|
|
- switcher.style.position = 'relative';
|
6124
|
|
- switcher.style.textAlign = 'center';
|
6125
|
|
- switcher.style.paddingTop = '4px';
|
6126
|
|
- switcher.style.width = '210px';
|
6127
|
|
-
|
6128
|
|
- div.style.paddingBottom = '8px';
|
6129
|
|
-
|
6130
|
|
- for (var i = 0; i < pageCount; i++)
|
6131
|
|
- {
|
6132
|
|
- var dot = document.createElement('div');
|
6133
|
|
- dot.style.display = 'inline-block';
|
6134
|
|
- dot.style.width = '6px';
|
6135
|
|
- dot.style.height = '6px';
|
6136
|
|
- dot.style.marginLeft = '4px';
|
6137
|
|
- dot.style.marginRight = '3px';
|
6138
|
|
- dot.style.borderRadius = '3px';
|
6139
|
|
- dot.style.cursor = 'pointer';
|
6140
|
|
- dot.style.background = 'transparent';
|
6141
|
|
- dot.style.border = '1px solid #b5b6b7';
|
|
6129
|
+// // Workaround for broken cache in IE11
|
|
6130
|
+// if (!mxClient.IS_IE && !mxClient.IS_IE11)
|
|
6131
|
+// {
|
|
6132
|
+// this.format.cachedStyleEntries[index] = panel;
|
|
6133
|
+// }
|
|
6134
|
+// }
|
|
6135
|
+
|
|
6136
|
+// entries.appendChild(panel);
|
|
6137
|
+// });
|
|
6138
|
+
|
|
6139
|
+// // Maximum palettes to switch the switcher
|
|
6140
|
+// var maxEntries = 10;
|
|
6141
|
+// var pageCount = Math.ceil(Editor.styles.length / maxEntries);
|
|
6142
|
+// this.format.currentStylePage = (this.format.currentStylePage != null) ? this.format.currentStylePage : 0;
|
|
6143
|
+// var dots = [];
|
|
6144
|
+
|
|
6145
|
+// var addEntries = mxUtils.bind(this, function()
|
|
6146
|
+// {
|
|
6147
|
+// if (dots.length > 0)
|
|
6148
|
+// {
|
|
6149
|
+// dots[this.format.currentStylePage].style.background = '#84d7ff';
|
|
6150
|
+// }
|
|
6151
|
+
|
|
6152
|
+// for (var i = this.format.currentStylePage * maxEntries;
|
|
6153
|
+// i < Math.min((this.format.currentStylePage + 1) * maxEntries,
|
|
6154
|
+// Editor.styles.length); i++)
|
|
6155
|
+// {
|
|
6156
|
+// var s = Editor.styles[i];
|
|
6157
|
+// addEntry(s.commonStyle, s.vertexStyle, s.edgeStyle, s.graph, i);
|
|
6158
|
+// }
|
|
6159
|
+// });
|
|
6160
|
+
|
|
6161
|
+// var selectPage = mxUtils.bind(this, function(index)
|
|
6162
|
+// {
|
|
6163
|
+// if (index >= 0 && index < pageCount)
|
|
6164
|
+// {
|
|
6165
|
+// dots[this.format.currentStylePage].style.background = 'transparent';
|
|
6166
|
+// entries.innerHTML = '';
|
|
6167
|
+// this.format.currentStylePage = index;
|
|
6168
|
+// addEntries();
|
|
6169
|
+// }
|
|
6170
|
+// });
|
|
6171
|
+
|
|
6172
|
+// if (pageCount > 1)
|
|
6173
|
+// {
|
|
6174
|
+// // Selector
|
|
6175
|
+// var switcher = document.createElement('div');
|
|
6176
|
+// switcher.style.whiteSpace = 'nowrap';
|
|
6177
|
+// switcher.style.position = 'relative';
|
|
6178
|
+// switcher.style.textAlign = 'center';
|
|
6179
|
+// switcher.style.paddingTop = '4px';
|
|
6180
|
+// switcher.style.width = '210px';
|
|
6181
|
+
|
|
6182
|
+// div.style.paddingBottom = '8px';
|
|
6183
|
+
|
|
6184
|
+// for (var i = 0; i < pageCount; i++)
|
|
6185
|
+// {
|
|
6186
|
+// var dot = document.createElement('div');
|
|
6187
|
+// dot.style.display = 'inline-block';
|
|
6188
|
+// dot.style.width = '6px';
|
|
6189
|
+// dot.style.height = '6px';
|
|
6190
|
+// dot.style.marginLeft = '4px';
|
|
6191
|
+// dot.style.marginRight = '3px';
|
|
6192
|
+// dot.style.borderRadius = '3px';
|
|
6193
|
+// dot.style.cursor = 'pointer';
|
|
6194
|
+// dot.style.background = 'transparent';
|
|
6195
|
+// dot.style.border = '1px solid #b5b6b7';
|
6142
|
6196
|
|
6143
|
|
- (mxUtils.bind(this, function(index, elt)
|
6144
|
|
- {
|
6145
|
|
- mxEvent.addListener(dot, 'click', mxUtils.bind(this, function()
|
6146
|
|
- {
|
6147
|
|
- selectPage(index);
|
6148
|
|
- }));
|
6149
|
|
- }))(i, dot);
|
|
6197
|
+// (mxUtils.bind(this, function(index, elt)
|
|
6198
|
+// {
|
|
6199
|
+// mxEvent.addListener(dot, 'click', mxUtils.bind(this, function()
|
|
6200
|
+// {
|
|
6201
|
+// selectPage(index);
|
|
6202
|
+// }));
|
|
6203
|
+// }))(i, dot);
|
6150
|
6204
|
|
6151
|
|
- switcher.appendChild(dot);
|
6152
|
|
- dots.push(dot);
|
6153
|
|
- }
|
6154
|
|
-
|
6155
|
|
- div.appendChild(switcher);
|
6156
|
|
- addEntries();
|
6157
|
|
-
|
6158
|
|
- if (pageCount < 15)
|
6159
|
|
- {
|
6160
|
|
- var left = document.createElement('div');
|
6161
|
|
- left.style.position = 'absolute';
|
6162
|
|
- left.style.left = '0px';
|
6163
|
|
- left.style.top = '0px';
|
6164
|
|
- left.style.bottom = '0px';
|
6165
|
|
- left.style.width = '24px';
|
6166
|
|
- left.style.height = '24px';
|
6167
|
|
- left.style.margin = '0px';
|
6168
|
|
- left.style.cursor = 'pointer';
|
6169
|
|
- left.style.opacity = '0.5';
|
6170
|
|
- left.style.backgroundRepeat = 'no-repeat';
|
6171
|
|
- left.style.backgroundPosition = 'center center';
|
6172
|
|
- left.style.backgroundSize = '24px 24px';
|
6173
|
|
- left.style.backgroundImage = 'url(' + Editor.previousImage + ')';
|
|
6205
|
+// switcher.appendChild(dot);
|
|
6206
|
+// dots.push(dot);
|
|
6207
|
+// }
|
|
6208
|
+
|
|
6209
|
+// div.appendChild(switcher);
|
|
6210
|
+// addEntries();
|
|
6211
|
+
|
|
6212
|
+// if (pageCount < 15)
|
|
6213
|
+// {
|
|
6214
|
+// var left = document.createElement('div');
|
|
6215
|
+// left.style.position = 'absolute';
|
|
6216
|
+// left.style.left = '0px';
|
|
6217
|
+// left.style.top = '0px';
|
|
6218
|
+// left.style.bottom = '0px';
|
|
6219
|
+// left.style.width = '24px';
|
|
6220
|
+// left.style.height = '24px';
|
|
6221
|
+// left.style.margin = '0px';
|
|
6222
|
+// left.style.cursor = 'pointer';
|
|
6223
|
+// left.style.opacity = '0.5';
|
|
6224
|
+// left.style.backgroundRepeat = 'no-repeat';
|
|
6225
|
+// left.style.backgroundPosition = 'center center';
|
|
6226
|
+// left.style.backgroundSize = '24px 24px';
|
|
6227
|
+// left.style.backgroundImage = 'url(' + Editor.previousImage + ')';
|
6174
|
6228
|
|
6175
|
|
- if (Editor.isDarkMode())
|
6176
|
|
- {
|
6177
|
|
- left.style.filter = 'invert(100%)';
|
6178
|
|
- }
|
|
6229
|
+// if (Editor.isDarkMode())
|
|
6230
|
+// {
|
|
6231
|
+// left.style.filter = 'invert(100%)';
|
|
6232
|
+// }
|
6179
|
6233
|
|
6180
|
|
- var right = left.cloneNode(false);
|
6181
|
|
- right.style.backgroundImage = 'url(' + Editor.nextImage + ')';
|
6182
|
|
- right.style.left = '';
|
6183
|
|
- right.style.right = '2px';
|
|
6234
|
+// var right = left.cloneNode(false);
|
|
6235
|
+// right.style.backgroundImage = 'url(' + Editor.nextImage + ')';
|
|
6236
|
+// right.style.left = '';
|
|
6237
|
+// right.style.right = '2px';
|
6184
|
6238
|
|
6185
|
|
- switcher.appendChild(left);
|
6186
|
|
- switcher.appendChild(right);
|
|
6239
|
+// switcher.appendChild(left);
|
|
6240
|
+// switcher.appendChild(right);
|
6187
|
6241
|
|
6188
|
|
- mxEvent.addListener(left, 'click', mxUtils.bind(this, function()
|
6189
|
|
- {
|
6190
|
|
- selectPage(mxUtils.mod(this.format.currentStylePage - 1, pageCount));
|
6191
|
|
- }));
|
|
6242
|
+// mxEvent.addListener(left, 'click', mxUtils.bind(this, function()
|
|
6243
|
+// {
|
|
6244
|
+// selectPage(mxUtils.mod(this.format.currentStylePage - 1, pageCount));
|
|
6245
|
+// }));
|
6192
|
6246
|
|
6193
|
|
- mxEvent.addListener(right, 'click', mxUtils.bind(this, function()
|
6194
|
|
- {
|
6195
|
|
- selectPage(mxUtils.mod(this.format.currentStylePage + 1, pageCount));
|
6196
|
|
- }));
|
|
6247
|
+// mxEvent.addListener(right, 'click', mxUtils.bind(this, function()
|
|
6248
|
+// {
|
|
6249
|
+// selectPage(mxUtils.mod(this.format.currentStylePage + 1, pageCount));
|
|
6250
|
+// }));
|
6197
|
6251
|
|
6198
|
|
- // Hover state
|
6199
|
|
- function addHoverState(elt)
|
6200
|
|
- {
|
6201
|
|
- mxEvent.addListener(elt, 'mouseenter', function()
|
6202
|
|
- {
|
6203
|
|
- elt.style.opacity = '1';
|
6204
|
|
- });
|
6205
|
|
- mxEvent.addListener(elt, 'mouseleave', function()
|
6206
|
|
- {
|
6207
|
|
- elt.style.opacity = '0.5';
|
6208
|
|
- });
|
6209
|
|
- };
|
|
6252
|
+// // Hover state
|
|
6253
|
+// function addHoverState(elt)
|
|
6254
|
+// {
|
|
6255
|
+// mxEvent.addListener(elt, 'mouseenter', function()
|
|
6256
|
+// {
|
|
6257
|
+// elt.style.opacity = '1';
|
|
6258
|
+// });
|
|
6259
|
+// mxEvent.addListener(elt, 'mouseleave', function()
|
|
6260
|
+// {
|
|
6261
|
+// elt.style.opacity = '0.5';
|
|
6262
|
+// });
|
|
6263
|
+// };
|
6210
|
6264
|
|
6211
|
|
- addHoverState(left);
|
6212
|
|
- addHoverState(right);
|
6213
|
|
- }
|
6214
|
|
- }
|
6215
|
|
- else
|
6216
|
|
- {
|
6217
|
|
- addEntries();
|
6218
|
|
- }
|
6219
|
|
-
|
6220
|
|
- return div;
|
6221
|
|
-};
|
|
6265
|
+// addHoverState(left);
|
|
6266
|
+// addHoverState(right);
|
|
6267
|
+// }
|
|
6268
|
+// }
|
|
6269
|
+// else
|
|
6270
|
+// {
|
|
6271
|
+// addEntries();
|
|
6272
|
+// }
|
|
6273
|
+
|
|
6274
|
+// return div;
|
|
6275
|
+// };
|
6222
|
6276
|
|
6223
|
6277
|
/**
|
6224
|
6278
|
* Adds the label menu items to the given menu and parent.
|
6225
|
6279
|
*/
|
6226
|
|
- DiagramStylePanel.prototype.destroy = function()
|
6227
|
|
- {
|
6228
|
|
- BaseFormatPanel.prototype.destroy.apply(this, arguments);
|
6229
|
|
-
|
6230
|
|
- if (this.darkModeChangedListener)
|
6231
|
|
- {
|
6232
|
|
- this.editorUi.removeListener(this.darkModeChangedListener);
|
6233
|
|
- this.darkModeChangedListener = null;
|
6234
|
|
- }
|
|
6280
|
+ DiagramStylePanel.prototype.destroy = function () {
|
|
6281
|
+ BaseFormatPanel.prototype.destroy.apply(this, arguments);
|
|
6282
|
+
|
|
6283
|
+ if (this.darkModeChangedListener) {
|
|
6284
|
+ this.editorUi.removeListener(this.darkModeChangedListener);
|
|
6285
|
+ this.darkModeChangedListener = null;
|
|
6286
|
+ }
|
6235
|
6287
|
};
|
6236
|
6288
|
|
6237
|
6289
|
/**
|
...
|
...
|
@@ -6264,13 +6316,13 @@ DiagramFormatPanel.prototype.init = function() |
6264
|
6316
|
var editor = ui.editor;
|
6265
|
6317
|
var graph = editor.graph;
|
6266
|
6318
|
|
6267
|
|
- this.container.appendChild(this.addView(this.createPanel()));
|
|
6319
|
+ // this.container.appendChild(this.addView(this.createPanel()));
|
6268
|
6320
|
|
6269
|
6321
|
if (graph.isEnabled())
|
6270
|
6322
|
{
|
6271
|
|
- this.container.appendChild(this.addOptions(this.createPanel()));
|
6272
|
|
- this.container.appendChild(this.addPaperSize(this.createPanel()));
|
6273
|
|
- this.container.appendChild(this.addStyleOps(this.createPanel()));
|
|
6323
|
+ // this.container.appendChild(this.addOptions(this.createPanel()));
|
|
6324
|
+ // this.container.appendChild(this.addPaperSize(this.createPanel()));
|
|
6325
|
+ // this.container.appendChild(this.addStyleOps(this.createPanel()));
|
6274
|
6326
|
}
|
6275
|
6327
|
};
|
6276
|
6328
|
|
...
|
...
|
|