コード例 #1
0
 private void printAndUpdateIndex(
     DrawHandler drawer,
     RelationPointHandler relationPoints,
     PointDouble pointText,
     int index,
     String text,
     Point displacement,
     Set<Integer> usedIndexes) {
   if (displacement != null) {
     pointText =
         new PointDouble(
             pointText.getX() + displacement.getX(), pointText.getY() + displacement.getY());
   }
   printAndUpdateIndex(drawer, relationPoints, pointText, index, text, usedIndexes);
 }
コード例 #2
0
  private void printAndUpdateIndex(
      DrawHandler drawer,
      RelationPointHandler relationPoints,
      PointDouble pointText,
      int index,
      String text,
      Set<Integer> usedIndexes) {
    drawer.print(text, pointText, AlignHorizontal.LEFT);

    // to make sure text is printed (and therefore withing relation-element-borders, resize relation
    // according to text
    relationPoints.setTextBox(
        index,
        new Rectangle(
            pointText.getX(),
            pointText.getY() - drawer.textHeightMax(),
            drawer.textWidth(text),
            drawer.textHeightMax()));
    usedIndexes.add(index);
  }