This commit is contained in:
bancika
2011-01-09 00:46:24 +00:00
parent 672aef6799
commit 94c53a2344
2 changed files with 12 additions and 7 deletions
@@ -37,7 +37,8 @@ import java.util.Map;
* creates an {@link Area} that corresponds to drawn objects. Before each
* component is drawn, {@link #startedDrawingComponent()} should be called.
* After the component is drawn, area may be retrieved using
* {@link #finishedDrawingComponent()}.
* {@link #finishedDrawingComponent()}. Graphics configuration (color, font,
* etc) is reset between each two components.
*
* @author Branislav Stojkovic
*/
@@ -49,7 +49,7 @@ import com.diyfever.gui.update.VersionNumber;
import com.rits.cloning.Cloner;
/**
* The main presenter class.
* The main presenter class, contains core app logic and drawing routines.
*
* @author Branislav Stojkovic
*/
@@ -341,11 +341,6 @@ public class Presenter implements IPlugInPort {
view.addMenuAction(action, menuName);
}
// @Override
// public void setCursorIcon(Icon icon) {
// view.setCursorIcon(icon);
// }
/**
* Finds all components whose areas include the specified {@link Point}.
* Point is <b>not</b> scaled by the zoom factor.
@@ -657,6 +652,10 @@ public class Presenter implements IPlugInPort {
calculateSelectionDimension());
}
/**
* @return selection size expressed in either inches or centimeters, based
* on the user preference.
*/
private Point2D calculateSelectionDimension() {
if (selectedComponents.isEmpty()) {
return null;
@@ -817,6 +816,11 @@ public class Presenter implements IPlugInPort {
(int) (point.y / zoomLevel));
}
/**
* @param component
* @return true if control points should be rendered for the specified
* component.
*/
private boolean shouldShowControlPointsFor(IDIYComponent<?> component) {
ComponentType componentType = componentTypeMap.get(component.getClass());
// Do not show control points for non-stretchable components.