Beispiel #1
0
 public void drawOn(StringBuilder input) {
   if (!isEnable()) return;
   printLinkStartElement(input);
   stringTemplate.reset();
   double x1, x2, y1, y2;
   x1 = sourceEntity.getXInLayout() + sourceEntity.getWidthInLayout() / 2.0;
   y1 = sourceEntity.getYInLayout() + sourceEntity.getHeightInLayout() / 2.0;
   x2 = destinationEntity.getXInLayout() + destinationEntity.getWidthInLayout() / 2.0;
   y2 = destinationEntity.getYInLayout() + destinationEntity.getHeightInLayout() / 2.0;
   stringTemplate.setAttribute("X1", x1);
   stringTemplate.setAttribute("X2", x2);
   stringTemplate.setAttribute("Y1", y1);
   stringTemplate.setAttribute("Y2", y2);
   double midX = (x1 + x2) / 2.0;
   double midY = (y1 + y2) / 2.0;
   stringTemplate.setAttribute("M1", midX);
   stringTemplate.setAttribute("M2", midY);
   stringTemplate.setAttribute("WIDTH", linewidth);
   stringTemplate.setAttribute("COLOR", SVGUtils.formatToHex(color.getRGB()));
   stringTemplate.setAttribute("OPAQUE", opaque);
   input.append(stringTemplate.toString());
   printLinkEndElement(input);
 }