implement resize feature
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user