handle multiple selection with shift
This commit is contained in:
@@ -29,11 +29,6 @@ public abstract class AbstractShape implements Shape {
|
||||
attributes.put(attrs.getID(), attrs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLoc(Point newLoc) {
|
||||
getBounds().setLocation(newLoc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void translate(int dx, int dy) {
|
||||
getBounds().translate(dx, dy);
|
||||
|
||||
@@ -12,7 +12,6 @@ import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Spliterator;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class SCollection extends AbstractShape implements Streamable<Shape> {
|
||||
private final static Logger logger = LoggerFactory.getLogger(SCollection.class);
|
||||
@@ -53,9 +52,8 @@ public class SCollection extends AbstractShape implements Streamable<Shape> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLoc(Point newLoc) {
|
||||
final Point loc = getBounds().getLocation();
|
||||
children.forEach(s -> s.translate(newLoc.x - loc.x, newLoc.y - loc.y));
|
||||
public void translate(int dx, int dy) {
|
||||
children.forEach(s -> s.translate(dx, dy));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -7,7 +7,6 @@ import java.awt.*;
|
||||
|
||||
public interface Shape {
|
||||
void accept(ShapeVisitor visitor);
|
||||
void setLoc(Point newLoc);
|
||||
void translate(int dx, int dy);
|
||||
Attributes getAttributes(String key);
|
||||
void addAttributes(Attributes attr);
|
||||
|
||||
Reference in New Issue
Block a user