Skip to content

Commit

Permalink
#19 Demonstrate how to draw an arrow between two images
Browse files Browse the repository at this point in the history
  • Loading branch information
ThetaSinner committed Oct 27, 2018
1 parent 0e41d77 commit abc7fd3
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package org.ephyra.acropolis.report.impl.render

import java.awt.BasicStroke
import java.awt.Color
import java.awt.Graphics2D
import java.awt.Polygon
import java.awt.image.BufferedImage
import java.awt.image.BufferedImage.TYPE_INT_RGB
import java.io.File
Expand Down Expand Up @@ -31,6 +33,21 @@ class DiagramRenderer(
ImageIO.write(targetImg, outFile.extension, outFile)
}

fun drawConnection() {
target.stroke = BasicStroke(4f)
target.color = Color.BLUE
target.drawLine(895, 550, 895, 800 - 20)

target.stroke = BasicStroke(2f)
target.color = Color.YELLOW
val polygon = Polygon()
polygon.addPoint(895, 800)
polygon.addPoint(895 - 20, 800 - 20)
polygon.addPoint(895 + 20, 800 - 20)
target.fill(polygon)
target.drawPolygon(polygon)
}

override fun close() {
target.dispose()
}
Expand Down

0 comments on commit abc7fd3

Please sign in to comment.