Base java event POC
This commit is contained in:
29
src/main/java/ovh/gasser/newshapes/ui/ShapesView.java
Normal file
29
src/main/java/ovh/gasser/newshapes/ui/ShapesView.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package ovh.gasser.newshapes.ui;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import ovh.gasser.newshapes.ShapeVisitor;
|
||||
import ovh.gasser.newshapes.shapes.Shape;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class ShapesView extends JPanel {
|
||||
final Logger logger = LoggerFactory.getLogger(ShapesView.class);
|
||||
|
||||
private final Shape model;
|
||||
private final Controller controller;
|
||||
private ShapeVisitor draftman;
|
||||
|
||||
public ShapesView(Shape model) {
|
||||
this.model = model;
|
||||
this.controller = new Controller(this, model);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
this.draftman = new ShapeDraftman(g);
|
||||
model.accept(draftman);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user