Graph View
* added simple Window for graph play * added new function to interface * all tests passes * end graph
This commit is contained in:
29
src/berack96/sim/util/graph/view/GraphicalView.java
Normal file
29
src/berack96/sim/util/graph/view/GraphicalView.java
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user