}
final BlockDevInfo destBDI = (BlockDevInfo) getInfo(dest);
if (destBDI == null) {
return "";
}
final BlockDevice sourceBD = sourceBDI.getBlockDevice();
final BlockDevice destBD = destBDI.getBlockDevice();
final Application.RunMode runMode = getRunMode();
if (!destBDI.isConnected(runMode)) {
if (sourceBDI.isWFConnection(runMode)
&& !destBDI.isWFConnection(runMode)) {
edge.setDirection(dest, source);
application.invokeLater(new Runnable() {
@Override
public void run() {
repaint();
}
});
}
} else if (!sourceBD.isPrimary() && destBD.isPrimary()) {
edge.setDirection(dest, source);
application.invokeLater(new Runnable() {
@Override
public void run() {
repaint();
}
});
}
final StringBuilder l = new StringBuilder(dvi.getNameForGraph());
final Map<Vertex, Point2D> vl = getVertexLocations();
final Point2D sp = vl.get(source);
final Point2D dp = vl.get(dest);
putVertexLocations();
final int len = (int) Math.sqrt(Math.pow(sp.getX() - dp.getX(), 2) + Math.pow(sp.getY() - dp.getY(), 2));
final int maxLen = (len - 200) / 7;
if (l.length() > maxLen) {
l.delete(0, l.length() - maxLen + 3);
l.insert(0, "...");
}
if (dvi.isSyncing()) {
String syncedProgress = dvi.getSyncedProgress();
if (syncedProgress == null) {
syncedProgress = "?.?";
}
final double sourceX = getLayout().transform(source).getX();
final double destX = getLayout().transform(dest).getX();
if (sourceBD.isPausedSync() || destBD.isPausedSync()) {
l.append(" (").append(syncedProgress).append("% paused)");
} else if (sourceBD.isSyncSource() && sourceX < destX
|| destBD.isSyncSource() && sourceX > destX) {
l.append(" (").append(syncedProgress).append("% \u2192)"); /* -> */
} else {
l.append(" (\u2190 ").append(syncedProgress).append("%)"); /* <- */
}
} else if (dvi.isSplitBrain()) {