selection rect

This commit is contained in:
bancika
2012-08-30 15:04:08 +00:00
parent 7f5f61f5b0
commit 8c3c6ea56e
2 changed files with 23 additions and 0 deletions
@@ -5,6 +5,7 @@ import java.awt.Dimension;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.Point; import java.awt.Point;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@@ -275,6 +276,11 @@ public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyP
*/ */
Point2D calculateSelectionDimension(); Point2D calculateSelectionDimension();
// /**
// * @return the smallest rectangle that encloses the selection
// */
// Rectangle2D getSelectedAreaRect();
/** /**
* Sends each of the selected components one step back. * Sends each of the selected components one step back.
*/ */
@@ -1533,6 +1533,23 @@ public class Presenter implements IPlugInPort {
return dimension; return dimension;
} }
// @Override
// public Rectangle2D getSelectedAreaRect() {
// if (selectedComponents.isEmpty()) {
// return null;
// }
// Area area = new Area();
// for (IDIYComponent<?> component : selectedComponents) {
// Area componentArea = drawingManager.getComponentArea(component);
// if (componentArea != null) {
// area.add(componentArea);
// } else {
// LOG.warn("No area found for: " + component.getName());
// }
// }
// return area.getBounds2D();
// }
/** /**
* Adds a component to the project taking z-order into account. * Adds a component to the project taking z-order into account.
* *