final ServiceInfo s2 = (ServiceInfo) getInfo(p.getFirst());
if (s2 == null) {
return "";
}
mHbConnectionReadLock.lock();
final HbConnectionInfo hbci;
try {
hbci = edgeToHbconnectionMap.get(e);
} finally {
mHbConnectionReadLock.unlock();
}
if (hbci == null) {
return "";
}
String leftArrow = "\u2190 "; /* <- */
String rightArrow = " \u2192"; /* -> */
final HbConnectionInfo.ColScoreType colSType = hbci.getColocationScoreType(null, null);
if (edgeIsColocation) {
if (hbci.isColocationTwoDirections()) {
leftArrow = "\u21AE "; /* </> */
rightArrow = "\u21AE "; /* </> */
} else if (colSType == HbConnectionInfo.ColScoreType.NEGATIVE
|| colSType == HbConnectionInfo.ColScoreType.MINUS_INFINITY) {
} else if (colSType == HbConnectionInfo.ColScoreType.IS_NULL) {
leftArrow = "\u21E0 "; /* < - - */
rightArrow = " \u21E2"; /* - - > */
} else if (colSType == HbConnectionInfo.ColScoreType.MIXED) {
leftArrow = "\u219A "; /* </- */
rightArrow = " \u219B"; /* -/> */
}
}
String colScore = "";
if (edgeIsColocation
&& colSType == HbConnectionInfo.ColScoreType.IS_NULL) {
colScore = "0";
}
String ordScore = "";
if (edgeIsOrder && hbci.isOrdScoreNull(null, null)) {
ordScore = "0";
}
String colDesc = null;
String ordDesc = null;
String desc = null;
if (edgeIsOrder && edgeIsColocation) {
if (colSType == HbConnectionInfo.ColScoreType.NEGATIVE
|| colSType == HbConnectionInfo.ColScoreType.MINUS_INFINITY) {
colDesc = "repelled";
} else {
colDesc = "col";
}
ordDesc = "ord";
} else if (edgeIsOrder) {
ordDesc = "ordered";
} else if (edgeIsColocation) {
if (colSType == HbConnectionInfo.ColScoreType.NEGATIVE
|| colSType == HbConnectionInfo.ColScoreType.MINUS_INFINITY) {
colDesc = "repelled";
} else {
colDesc = "colocated";
}
} else if (s1.getService().isNew() || s2.getService().isNew()) {
desc = Tools.getString("CRMGraph.Unconfigured");
} else {
desc = Tools.getString("CRMGraph.Removing");
}
if (desc != null) {
return desc;
}
final Vertex v1 = p.getSecond();
final Vertex v2 = p.getFirst();
double s1X = 0;
final Point2D loc1 = getLayout().transform(v1);
if (loc1 != null) {
s1X = loc1.getX();
}
final Point2D loc2 = getLayout().transform(v2);
double s2X = 0;
if (loc2 != null) {
s2X = loc2.getX();
}
final StringBuilder sb = new StringBuilder(15);
final boolean upsideDown = s1X < s2X;
final boolean left = hbci.isWithRsc(s2) && !e.isWrongColocation();
if (edgeIsColocation) {
if ((left && !upsideDown) || (!left && upsideDown)) {
sb.append(leftArrow); /* <- */
sb.append(colScore);
sb.append(' ');