Commit b2556811 authored by Nico Mack's avatar Nico Mack

Added stoppedMoving method to Zoomable required for GIS based

applications
Added methods for drawing rounded rectangles to ShapeFactory utility
class.
parent 737dc36f
/.DS_Store
......@@ -57,4 +57,13 @@ public interface Zoomable {
* only executable when the zooming stopped.
*/
public void stoppedZooming();
/**
* Method called by the manager handling the {@link Zoomable} instance when the state changed to
* where it is no longer considered moving. This method provides the opportunity to run code
* only executable when the moving stopped.
*/
public void stoppedMoving();
}
\ No newline at end of file
......@@ -108,6 +108,21 @@ public class ShapeFactory {
return new RoundRectangle2D.Float(-squareSize / 2f, -squareSize / 2, squareSize, squareSize, 5, 5);
}
/**
* Method for building a rounded rectangle.
*
* @param width
* The width the rectangle should take.
* @param height
* The height the rectangle should take.
* @param cornerRadius
* The radius of the corner the rounded rectangle should have.
* @return A {@link java.awt.geom.RoundRectangle2D.Float} instance.
*/
public static RoundRectangle2D.Float buildRoundedRectangle(int width, int height, int cornerRadius) {
return new RoundRectangle2D.Float(-width / 2f, -height / 2, width, height, cornerRadius, cornerRadius);
}
/**
* Method for building a square.
*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment