Skip to content

Commit

Permalink
6.7.4 release
Browse files Browse the repository at this point in the history
Former-commit-id: 99ed564
  • Loading branch information
alderg committed Jun 5, 2017
1 parent 8385061 commit 8904e4f
Show file tree
Hide file tree
Showing 17 changed files with 391 additions and 176 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
05-JUN-2017: 6.7.4

- Fixes overridden rounded style for non-rounded shapes
- Adds defaultVertexStyle/defaultEdgeStyle in Editor.configure
- Adds replay plugin

03-JUN-2017: 6.7.3

- Updates Gliffy translations to add Flowchart v2 library
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.7.3
6.7.4
98 changes: 55 additions & 43 deletions src/com/mxgraph/io/mxVsdxCodec.java
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,22 @@ public static void rotatedPoint(mxGeometry geo, double rotation,
geo.setY(Math.round(y1 + cy - geo.getHeight() / 2));
}

public static void rotatedEdgePoint(mxPoint pt, double rotation,
double cx, double cy)
{
rotation = Math.toRadians(rotation);
double cos = Math.cos(rotation), sin = Math.sin(rotation);

double x = pt.getX() - cx;
double y = pt.getY() - cy;

double x1 = x * cos - y * sin;
double y1 = y * cos + x * sin;

pt.setX(Math.round(x1 + cx));
pt.setY(Math.round(y1 + cy));
}

/**
* Adds a simple shape to the graph
* @param graph Graph where the parsed graph is included.
Expand Down Expand Up @@ -924,11 +940,11 @@ protected ShapePageId addConnectedEdge(mxGraph graph, mxVsdxConnect connect, Int

//Get beginXY and endXY coordinates.
mxPoint beginXY = edgeShape.getStartXY(parentHeight);
mxPoint origBeginXY = new mxPoint(beginXY);

beginXY = calculateAbsolutePoint(parent, graph, beginXY);
mxPoint endXY = edgeShape.getEndXY(parentHeight);
List<mxPoint> points = edgeShape.getRoutingPoints(parentHeight, beginXY, edgeShape.getRotation());

rotateChildEdge(graph.getModel(), parent, beginXY, endXY, points);

mxPoint fromConstraint = null;
Integer sourceSheet = connect.getSourceToSheet();

mxCell source = sourceSheet != null ? vertexMap
Expand All @@ -938,16 +954,10 @@ protected ShapePageId addConnectedEdge(mxGraph graph, mxVsdxConnect connect, Int
{
// Source is dangling
source = (mxCell) graph.insertVertex(parent, null, null,
origBeginXY.getX(), origBeginXY.getY(), 0, 0);
fromConstraint = new mxPoint(0, 0);
beginXY.getX(), beginXY.getY(), 0, 0);
}
//Else: Routing points will contain the exit/entry points, so no need to set the to/from constraint

mxPoint endXY = edgeShape.getEndXY(parentHeight);
mxPoint originEndXY = new mxPoint(endXY);
endXY = calculateAbsolutePoint(parent, graph, endXY);

mxPoint toConstraint = null;
Integer toSheet = connect.getTargetToSheet();

mxCell target = toSheet != null ? vertexMap.get(new ShapePageId(
Expand All @@ -957,8 +967,7 @@ protected ShapePageId addConnectedEdge(mxGraph graph, mxVsdxConnect connect, Int
{
// Target is dangling
target = (mxCell) graph.insertVertex(parent, null, null,
originEndXY.getX(), originEndXY.getY(), 0, 0);
toConstraint = new mxPoint(0, 0);
endXY.getX(), endXY.getY(), 0, 0);
}
//Else: Routing points will contain the exit/entry points, so no need to set the to/from constraint

Expand All @@ -967,7 +976,6 @@ protected ShapePageId addConnectedEdge(mxGraph graph, mxVsdxConnect connect, Int
.getStyleFromEdgeShape(parentHeight);
//Insert new edge and set constraints.
Object edge;
List<mxPoint> points = edgeShape.getRoutingPoints(parentHeight, origBeginXY, edgeShape.getRotation());
double rotation = edgeShape.getRotation();
if (rotation != 0)
{
Expand Down Expand Up @@ -998,17 +1006,6 @@ protected ShapePageId addConnectedEdge(mxGraph graph, mxVsdxConnect connect, Int
mxGeometry edgeGeometry = graph.getModel().getGeometry(edge);
edgeGeometry.setPoints(points);

if (fromConstraint != null)
{
graph.setConnectionConstraint(edge, source, true,
new mxConnectionConstraint(fromConstraint, false));
}
if (toConstraint != null)
{
graph.setConnectionConstraint(edge, target, false,
new mxConnectionConstraint(toConstraint, false));
}

//Gets and sets routing points of the edge.
if (styleMap.containsKey("curved")
&& styleMap.get("curved").equals("1"))
Expand All @@ -1022,24 +1019,6 @@ protected ShapePageId addConnectedEdge(mxGraph graph, mxVsdxConnect connect, Int
return edgeId;
}

/**
* Find the top parent in a group
*
* @param cell
* @return the top most parent (which has the defaultParent as its parent)
*/
private mxCell findTopParent(mxCell cell, mxCell defaultParent)
{
mxCell parent = (mxCell) cell.getParent();

while (parent.getParent() != null && parent.getParent() != defaultParent)
{
parent = (mxCell) parent.getParent();
}

return parent;
}

/**
* Adds a new edge not connected to any vertex to the graph.
* @param graph Graph where the parsed graph is included.
Expand Down Expand Up @@ -1111,6 +1090,9 @@ protected Object addUnconnectedEdge(mxGraph graph, Object parent, VsdxShape edge
mxPoint lblOffset = edgeShape.getLblEdgeOffset(graph.getView(), points);
((mxCell)edge).getGeometry().setOffset(lblOffset);
}

rotateChildEdge(graph.getModel(), parent, beginXY, endXY, points);

mxGeometry edgeGeometry = graph.getModel().getGeometry(edge);
edgeGeometry.setPoints(points);

Expand All @@ -1130,6 +1112,36 @@ protected Object addUnconnectedEdge(mxGraph graph, Object parent, VsdxShape edge
return edge;
}

protected void rotateChildEdge(mxIGraphModel model, Object parent, mxPoint beginXY, mxPoint endXY, List<mxPoint> points) {
//Rotate all points based on parent rotation
//Must get parent rotation and apply it similar to what we did in group rotation of all children
if (parent != null)
{
mxGeometry pgeo = model.getGeometry(parent);
String pStyle = model.getStyle(parent);

if (pgeo != null && pStyle != null)
{
int pos = pStyle.indexOf("rotation=");

if (pos > -1)
{
double pRotation = Double.parseDouble(pStyle.substring(pos + 9, pStyle.indexOf(';', pos))); //9 is the length of "rotation="

double hw = pgeo.getWidth() / 2, hh = pgeo.getHeight() / 2;

rotatedEdgePoint(beginXY, pRotation, hw, hh);
rotatedEdgePoint(endXY, pRotation, hw, hh);

for (mxPoint p : points)
{
rotatedEdgePoint(p, pRotation, hw, hh);
}
}
}
}
}

/**
* Post processes groups to remove leaf vertices that render nothing
* @param group
Expand Down
2 changes: 1 addition & 1 deletion war/cache.manifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CACHE MANIFEST

# THIS FILE WAS GENERATED. DO NOT MODIFY!
# 06/03/2017 09:45 AM
# 06/05/2017 12:53 PM

app.html
index.html?offline=1
Expand Down
12 changes: 6 additions & 6 deletions war/images/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@
"name": "draw.io",
"icons": [
{
"src": "images\/android-chrome-36x36.png",
"src": "\/images\/android-chrome-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": 0.75
},
{
"src": "images\/android-chrome-48x48.png",
"src": "\/images\/android-chrome-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": 1
},
{
"src": "images\/android-chrome-72x72.png",
"src": "\/images\/android-chrome-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": 1.5
},
{
"src": "images\/android-chrome-96x96.png",
"src": "\/images\/android-chrome-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": 2
},
{
"src": "images\/android-chrome-144x144.png",
"src": "\/images\/android-chrome-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": 3
},
{
"src": "images\/android-chrome-192x192.png",
"src": "\/images\/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": 4
Expand Down
Loading

0 comments on commit 8904e4f

Please sign in to comment.