Skip to content

Commit

Permalink
24.0.4 release
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgraph committed Mar 11, 2024
1 parent 4a226fe commit cf329b3
Show file tree
Hide file tree
Showing 14 changed files with 1,572 additions and 1,555 deletions.
14 changes: 7 additions & 7 deletions src/main/mxgraph/shape/mxShape.js
Expand Up @@ -521,12 +521,12 @@ mxShape.prototype.getShadowStyle = function()
*
* Removes all child nodes and resets all CSS.
*/
mxShape.prototype.createDropShadow = function(shadowStyle, scale)
mxShape.prototype.createDropShadow = function(style, scale)
{
return 'drop-shadow(' + Math.round(shadowStyle.dx * scale * 100) / 100 + 'px ' +
Math.round(shadowStyle.dy * scale * 100) / 100 + 'px ' +
Math.round(shadowStyle.blur * scale * 100) / 100 + 'px ' +
mxUtils.hex2rgba(shadowStyle.color, shadowStyle.opacity / 100) + ')';
return 'drop-shadow(' + Math.round(style.dx * scale * 100) / 100 + 'px ' +
Math.round(style.dy * scale * 100) / 100 + 'px ' +
Math.round(style.blur * scale * 100) / 100 + 'px ' +
mxUtils.hex2rgba(style.color, style.opacity / 100) + ')';
};

/**
Expand All @@ -536,7 +536,7 @@ mxShape.prototype.createDropShadow = function(shadowStyle, scale)
*/
mxShape.prototype.updateSvgFilters = function(scale)
{
this.node.style.filter = (this.isShadow && this.isShadowEnabled()) ?
this.node.style.filter = (this.isShadowEnabled()) ?
this.createDropShadow(this.getShadowStyle(), scale) : '';
};

Expand All @@ -547,7 +547,7 @@ mxShape.prototype.updateSvgFilters = function(scale)
*/
mxShape.prototype.isShadowEnabled = function()
{
return true;
return this.isShadow;
};

/**
Expand Down
3 changes: 2 additions & 1 deletion src/main/mxgraph/shape/mxText.js
Expand Up @@ -708,7 +708,8 @@ mxText.prototype.configureCanvas = function(c, x, y, w, h)
*/
mxText.prototype.isShadowEnabled = function()
{
return (this.style != null) ? mxUtils.getValue(this.style, 'textShadow', false) : false;
return (this.style != null) ? mxUtils.getValue(this.style,
mxConstants.STYLE_TEXT_SHADOW, false) : false;
};

/**
Expand Down
127 changes: 64 additions & 63 deletions src/main/webapp/js/app.min.js

Large diffs are not rendered by default.

27 changes: 10 additions & 17 deletions src/main/webapp/js/diagramly/Editor.js
Expand Up @@ -386,52 +386,45 @@
{
return mxUtils.getValue(state.style, 'sketch', (urlParams['rough'] == '1') ? '1' : '0') == '1';
}},
{name: mxConstants.STYLE_SHADOW, dispName: mxResources.get('Shadow'), type: 'bool', defVal: false, isVisible: function(state, format)
{
return state.containsLabel;
}, onChange: function(graph, value)
{
// Toggles text shadow together with shape shadow
graph.setCellStyles(mxConstants.STYLE_TEXT_SHADOW, value, graph.getSelectionCells());
}},
{name: mxConstants.STYLE_TEXT_SHADOW, dispName: 'Text Shadow', type: 'bool', defVal: false, isVisible: function(state, format)
{
return mxUtils.getValue(state.style, 'shadow', '0') == '1';
}},
{name: mxConstants.STYLE_SHADOWCOLOR, dispName: 'Shadow Color', type: 'color', getDefaultValue: function()
{
return mxConstants.SHADOWCOLOR;
}, isVisible: function(state, format)
{
return mxUtils.getValue(state.style, 'shadow', '0') == '1';
return mxUtils.getValue(state.style, mxConstants.STYLE_SHADOW, '0') == '1' ||
mxUtils.getValue(state.style, mxConstants.STYLE_TEXT_SHADOW, '0') == '1';
}},
{name: mxConstants.STYLE_SHADOW_OPACITY, dispName: 'Shadow Opacity', type: 'int', min: 0, max: 100, getDefaultValue: function()
{
return mxConstants.SHADOW_OPACITY * 100;
}, isVisible: function(state, format)
{
return mxUtils.getValue(state.style, 'shadow', '0') == '1';
return mxUtils.getValue(state.style, mxConstants.STYLE_SHADOW, '0') == '1' ||
mxUtils.getValue(state.style, mxConstants.STYLE_TEXT_SHADOW, '0') == '1';
}},
{name: mxConstants.STYLE_SHADOW_OFFSET_X, dispName: 'Shadow Offset X', type: 'int', getDefaultValue: function()
{
return mxConstants.SHADOW_OFFSET_X;
}, isVisible: function(state, format)
{
return mxUtils.getValue(state.style, 'shadow', '0') == '1';
return mxUtils.getValue(state.style, mxConstants.STYLE_SHADOW, '0') == '1' ||
mxUtils.getValue(state.style, mxConstants.STYLE_TEXT_SHADOW, '0') == '1';
}},
{name: mxConstants.STYLE_SHADOW_OFFSET_Y, dispName: 'Shadow Offset Y', type: 'int', getDefaultValue: function()
{
return mxConstants.SHADOW_OFFSET_Y;
}, isVisible: function(state, format)
{
return mxUtils.getValue(state.style, 'shadow', '0') == '1';
return mxUtils.getValue(state.style, mxConstants.STYLE_SHADOW, '0') == '1' ||
mxUtils.getValue(state.style, mxConstants.STYLE_TEXT_SHADOW, '0') == '1';
}},
{name: mxConstants.STYLE_SHADOW_BLUR, dispName: 'Shadow Blur', type: 'int', min: 0, getDefaultValue: function()
{
return mxConstants.SHADOW_BLUR;
}, isVisible: function(state, format)
{
return mxUtils.getValue(state.style, 'shadow', '0') == '1';
return mxUtils.getValue(state.style, mxConstants.STYLE_SHADOW, '0') == '1' ||
mxUtils.getValue(state.style, mxConstants.STYLE_TEXT_SHADOW, '0') == '1';
}}
];

Expand Down
7 changes: 6 additions & 1 deletion src/main/webapp/js/diagramly/Trees.js
Expand Up @@ -1241,6 +1241,7 @@
this.moveHandle.style.width = '24px';
this.moveHandle.style.height = '24px';
this.graph.container.appendChild(this.moveHandle);
this.redrawMoveHandle();

mxEvent.addGestureListeners(this.moveHandle, mxUtils.bind(this, function(evt)
{
Expand All @@ -1261,7 +1262,11 @@
mxVertexHandler.prototype.redrawHandles = function()
{
vertexHandlerRedrawHandles.apply(this, arguments);

this.redrawMoveHandle();
};

mxVertexHandler.prototype.redrawMoveHandle = function()
{
if (this.moveHandle != null)
{
this.moveHandle.style.left = this.state.x + this.state.width +
Expand Down
51 changes: 32 additions & 19 deletions src/main/webapp/js/grapheditor/Format.js
Expand Up @@ -3215,14 +3215,14 @@ TextFormatPanel.prototype.addFont = function(container)

var directions = ['topLeft', 'top', 'topRight', 'left', 'center', 'right', 'bottomLeft', 'bottom', 'bottomRight'];
var lset = {'topLeft': [mxConstants.ALIGN_LEFT, mxConstants.ALIGN_TOP, mxConstants.ALIGN_RIGHT, mxConstants.ALIGN_BOTTOM],
'top': [mxConstants.ALIGN_CENTER, mxConstants.ALIGN_TOP, mxConstants.ALIGN_CENTER, mxConstants.ALIGN_BOTTOM],
'topRight': [mxConstants.ALIGN_RIGHT, mxConstants.ALIGN_TOP, mxConstants.ALIGN_LEFT, mxConstants.ALIGN_BOTTOM],
'left': [mxConstants.ALIGN_LEFT, mxConstants.ALIGN_MIDDLE, mxConstants.ALIGN_RIGHT, mxConstants.ALIGN_MIDDLE],
'center': [mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE],
'right': [mxConstants.ALIGN_RIGHT, mxConstants.ALIGN_MIDDLE, mxConstants.ALIGN_LEFT, mxConstants.ALIGN_MIDDLE],
'bottomLeft': [mxConstants.ALIGN_LEFT, mxConstants.ALIGN_BOTTOM, mxConstants.ALIGN_RIGHT, mxConstants.ALIGN_TOP],
'bottom': [mxConstants.ALIGN_CENTER, mxConstants.ALIGN_BOTTOM, mxConstants.ALIGN_CENTER, mxConstants.ALIGN_TOP],
'bottomRight': [mxConstants.ALIGN_RIGHT, mxConstants.ALIGN_BOTTOM, mxConstants.ALIGN_LEFT, mxConstants.ALIGN_TOP]};
'top': [mxConstants.ALIGN_CENTER, mxConstants.ALIGN_TOP, mxConstants.ALIGN_CENTER, mxConstants.ALIGN_BOTTOM],
'topRight': [mxConstants.ALIGN_RIGHT, mxConstants.ALIGN_TOP, mxConstants.ALIGN_LEFT, mxConstants.ALIGN_BOTTOM],
'left': [mxConstants.ALIGN_LEFT, mxConstants.ALIGN_MIDDLE, mxConstants.ALIGN_RIGHT, mxConstants.ALIGN_MIDDLE],
'center': [mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE, mxConstants.ALIGN_CENTER, mxConstants.ALIGN_MIDDLE],
'right': [mxConstants.ALIGN_RIGHT, mxConstants.ALIGN_MIDDLE, mxConstants.ALIGN_LEFT, mxConstants.ALIGN_MIDDLE],
'bottomLeft': [mxConstants.ALIGN_LEFT, mxConstants.ALIGN_BOTTOM, mxConstants.ALIGN_RIGHT, mxConstants.ALIGN_TOP],
'bottom': [mxConstants.ALIGN_CENTER, mxConstants.ALIGN_BOTTOM, mxConstants.ALIGN_CENTER, mxConstants.ALIGN_TOP],
'bottomRight': [mxConstants.ALIGN_RIGHT, mxConstants.ALIGN_BOTTOM, mxConstants.ALIGN_LEFT, mxConstants.ALIGN_TOP]};

for (var i = 0; i < directions.length; i++)
{
Expand Down Expand Up @@ -3530,7 +3530,9 @@ TextFormatPanel.prototype.addFont = function(container)
graph.stylesheet.getDefaultVertexStyle() :
graph.stylesheet.getDefaultEdgeStyle();

var panel = (graph.cellEditor.isContentEditing()) ? this.createColorOption(mxResources.get('fontColor'), function()
var panel = (graph.cellEditor.isContentEditing()) ?
this.createColorOption(mxResources.get('fontColor'),
function()
{
return currentFontColor;
}, function(color)
Expand Down Expand Up @@ -3570,7 +3572,8 @@ TextFormatPanel.prototype.addFont = function(container)
var child = newFonts[i].firstChild;

// Moves the font element to inside the anchor element and adopts all children
if (child != null && child.nodeName == 'A' && child.nextSibling == null &&
if (child != null && child.nodeName == 'A' &&
child.nextSibling == null &&
child.firstChild != null)
{
var parent = newFonts[i].parentNode;
Expand All @@ -3593,13 +3596,15 @@ TextFormatPanel.prototype.addFont = function(container)
}
else
{
document.execCommand('forecolor', false, (color != mxConstants.NONE) ?
color : 'transparent');
document.execCommand('forecolor', false,
(color != mxConstants.NONE) ?
color : 'transparent');
ui.fireEvent(new mxEventObject('styleChanged',
'keys', [mxConstants.STYLE_FONTCOLOR],
'values', [color], 'cells', ss.cells));
}
}, (defs[mxConstants.STYLE_FONTCOLOR] != null) ? defs[mxConstants.STYLE_FONTCOLOR] : graph.shapeForegroundColor,
}, (defs[mxConstants.STYLE_FONTCOLOR] != null) ?
defs[mxConstants.STYLE_FONTCOLOR] : graph.shapeForegroundColor,
{
install: function(apply) { fontColorApply = apply; },
destroy: function() { fontColorApply = null; }
Expand Down Expand Up @@ -3640,11 +3645,23 @@ TextFormatPanel.prototype.addFont = function(container)
colorPanel.appendChild(panel);
colorPanel.appendChild(bgPanel);

var textShadow = this.createCellOption(mxResources.get('shadow'),
mxConstants.STYLE_TEXT_SHADOW, 0);
textShadow.style.width = '100%';
textShadow.style.fontWeight = 'bold';

if (!Editor.enableShadowOption)
{
textShadow.getElementsByTagName('input')[0].setAttribute('disabled', 'disabled');
mxUtils.setOpacity(textShadow, 60);
}

if (!graph.cellEditor.isContentEditing())
{
colorPanel.appendChild(borderPanel);
colorPanel.appendChild(textShadow);
}

container.appendChild(colorPanel);

var extraPanel = this.createPanel();
Expand Down Expand Up @@ -5987,11 +6004,7 @@ StyleFormatPanel.prototype.addEffects = function(div)
addOption(mxResources.get('glass'), mxConstants.STYLE_GLASS, 0);
}

var option = addOption(mxResources.get('shadow'), mxConstants.STYLE_SHADOW, 0, function(cells, value)
{
// Toggles text shadow together with shape shadow
graph.setCellStyles(mxConstants.STYLE_TEXT_SHADOW, value, cells);
});
var option = addOption(mxResources.get('shadow'), mxConstants.STYLE_SHADOW, 0);

if (!Editor.enableShadowOption)
{
Expand Down
17 changes: 9 additions & 8 deletions src/main/webapp/js/grapheditor/Graph.js
Expand Up @@ -1443,6 +1443,7 @@ Graph.textStyles = ['fontFamily', 'fontSource', 'fontSize', 'fontColor', 'fontSt
*/
Graph.edgeStyles = ['edgeStyle', 'elbow', 'jumpStyle', 'jumpSize', 'startArrow',
'startFill', 'startSize', 'endArrow', 'endFill', 'endSize', 'flowAnimation',
'flowAnimationDirection', 'flowAnimationTimingFunction', 'flowAnimationDuration',
'sourcePerimeterSpacing', 'targetPerimeterSpacing', 'curved'];

/**
Expand Down Expand Up @@ -2028,12 +2029,6 @@ Graph.exploreFromCell = function(sourceGraph, selectionCell, config)
}
};



console.log('graph', graph);



var cx = graph.container.scrollWidth / 2;
var cy = graph.container.scrollHeight / 3;

Expand Down Expand Up @@ -2187,7 +2182,13 @@ Graph.exploreFromCell = function(sourceGraph, selectionCell, config)

for (var i = 0; i < edges.length; i++)
{
if (edges[i].getTerminal(true) != null && edges[i].getTerminal(false) != null)
if (edges[i].getTerminal(true) != null &&
edges[i].getTerminal(false) != null &&
sourceGraph.isCellVisible(edges[i]) &&
sourceGraph.isCellVisible(edges[i].getTerminal(true)) &&
sourceGraph.isCellVisible(edges[i].getTerminal(false)) &&
sourceGraph.isCellVisible(sourceGraph.getLayerForCell(edges[i])) &&
mxUtils.getValue(sourceGraph.getCellStyle(edges[i]), 'ignoreEdge', '0') != '1')
{
validEdges.push(edges[i]);
}
Expand Down Expand Up @@ -14848,7 +14849,7 @@ if (typeof mxVertexHandler !== 'undefined')
'<stop offset="30%" style="stop-color:#f0f0f0;" /><stop offset="100%" style="stop-color:#AFB0B6;" /></linearGradient></defs>' +
'<rect x="0" y="0" width="9" height="9" stroke="#8A94A5" fill="url(#grad1)" stroke-width="2"/>' +
'<path d="M 4.5 2 L 4.5 7 M 2 4.5 L 7 4.5 z" stroke="#000"/>');

/**
* Updates the hint for the current operation.
*/
Expand Down

0 comments on commit cf329b3

Please sign in to comment.