public class ScaleControls extends AbstractSelectionControls
Modifier and Type | Class and Description |
---|---|
protected class |
ScaleControls.AbstractResizeHandle |
protected class |
ScaleControls.AnchorHL
A highlight that displays a little cross where the logical resize anchor is placed.
|
protected class |
ScaleControls.EResizeHandle |
protected class |
ScaleControls.NEResizeHandle |
protected class |
ScaleControls.NResizeHandle |
protected class |
ScaleControls.NWResizeHandle |
protected class |
ScaleControls.SEResizeHandle |
protected class |
ScaleControls.SResizeHandle |
protected class |
ScaleControls.SWResizeHandle |
protected class |
ScaleControls.WResizeHandle |
Modifier and Type | Field and Description |
---|---|
static ShapePaint |
DEFAULT_HOVER_PAINT |
static ShapePaint |
DEFAULT_NORMAL_PAINT |
protected boolean |
dragging |
Constructor and Description |
---|
ScaleControls() |
Modifier and Type | Method and Description |
---|---|
protected void |
dragEnd() |
protected void |
dragged(java.awt.geom.Point2D anchor,
java.awt.geom.Point2D handle,
java.awt.geom.Point2D drag,
int modifiers,
int side) |
protected void |
dragStart() |
protected void |
initHandles() |
void |
initialize(DesignPanel panel,
DesignableContainer container,
DesignableDelegate delegate,
java.util.List<javax.swing.JComponent> selection) |
protected IHandle |
newHandle(int side) |
static java.awt.geom.Rectangle2D |
scale(DesignPanel panel,
DesignableDelegate delegate,
java.util.List<javax.swing.JComponent> selection,
java.awt.geom.Rectangle2D originalRectangle,
java.util.Map<javax.swing.JComponent,java.awt.geom.Rectangle2D> originalBounds,
java.util.Map<javax.swing.JComponent,java.awt.geom.Rectangle2D> scaledBounds,
java.awt.geom.Point2D anchor,
java.awt.geom.Point2D handle,
java.awt.geom.Point2D drag,
int side,
boolean restrict,
boolean snap,
boolean keepAspectRatio) |
getBoundingRect, getInsets, iterator, paintBackground, selectionRect, uninstall
protected boolean dragging
public static final ShapePaint DEFAULT_NORMAL_PAINT
public static final ShapePaint DEFAULT_HOVER_PAINT
public void initialize(DesignPanel panel, DesignableContainer container, DesignableDelegate delegate, java.util.List<javax.swing.JComponent> selection)
initialize
in interface ISelectionControl
initialize
in class AbstractSelectionControls
protected void initHandles()
protected IHandle newHandle(int side)
protected void dragStart()
protected void dragEnd()
protected void dragged(java.awt.geom.Point2D anchor, java.awt.geom.Point2D handle, java.awt.geom.Point2D drag, int modifiers, int side)
public static java.awt.geom.Rectangle2D scale(DesignPanel panel, DesignableDelegate delegate, java.util.List<javax.swing.JComponent> selection, java.awt.geom.Rectangle2D originalRectangle, java.util.Map<javax.swing.JComponent,java.awt.geom.Rectangle2D> originalBounds, java.util.Map<javax.swing.JComponent,java.awt.geom.Rectangle2D> scaledBounds, java.awt.geom.Point2D anchor, java.awt.geom.Point2D handle, java.awt.geom.Point2D drag, int side, boolean restrict, boolean snap, boolean keepAspectRatio)
originalRectangle
- The overall bounding rectangle of all selected objects at the beginning of the scale
operation. In unzoomed coordinates.originalBounds
- The original bounds of each selected object, relative to the interaction layer in
unzoomed coordinates.scaledBounds
- A map containing the last set of scaled bounds for each object in unzoomed coordinates.
On the first scale of a series, this should be a clone of the originalBounds.anchor
- The anchor point for the scale - this is the 'fixed point'handle
- The handle point that the drag point is compared against.drag
- The point that the current drag is at.side
- The side code that the anchor resides on.restrict
- Whether or not to restrict to parent boundssnap
- Whether or not to consider snapping to gridkeepAspectRatio
- Whether or not to maintain original aspect ratios