Graph View

* added simple Window for graph play
* added new function to interface
* all tests passes
* end graph
This commit is contained in:
2019-02-26 21:58:53 +01:00
parent b441871de0
commit cdc183754f
23 changed files with 2203 additions and 1053 deletions

View File

@@ -0,0 +1,29 @@
package berack96.sim.util.graph.view;
import java.awt.*;
/**
* An interface for divide the "hitbox" and the "paint" of the various items
*
* @param <O> the object to paint
* @author Berack96
*/
public interface GraphicalView<O> {
/**
* Box where the object is sensible at listeners (like Hitbox)
*
* @param obj the object to draw
* @param center the center point of the object
* @return a rectangle where the object is sensible to the listeners
*/
Rectangle getBox(O obj, Point center);
/**
* The paint function, aka the part where you can draw things (like Mesh)
*
* @param g2 the graphics object used for painting
* @param obj the object to paint
* @param center the center point of the object
*/
void paint(Graphics2D g2, O obj, Point center);
}