implement resize feature

This commit is contained in:
2026-03-19 22:20:23 +01:00
parent 332ac76a23
commit b34ad6a2e4
9 changed files with 249 additions and 9 deletions

View File

@@ -12,6 +12,7 @@ public class ShapesView extends JPanel {
private final Shape model;
private final Controller controller;
private ShapeVisitor draftman;
private boolean resizeMode;
public ShapesView(SCollection model) {
this.model = model;
@@ -22,6 +23,7 @@ public class ShapesView extends JPanel {
protected void paintComponent(Graphics g) {
super.paintComponent(g);
this.draftman = new ShapeDraftman(g);
((ShapeDraftman) this.draftman).setResizeMode(resizeMode);
model.accept(draftman);
}
@@ -32,4 +34,8 @@ public class ShapesView extends JPanel {
public void addSelectionChangeListener(SelectionListener listener) {
controller.addSelectionChangeListener(listener);
}
public void setResizeMode(boolean resizeMode) {
this.resizeMode = resizeMode;
}
}