Class ZoomingRelativeHandleLocator
- java.lang.Object
-
- org.eclipse.draw2d.RelativeLocator
-
- org.eclipse.graphiti.ui.internal.util.draw2d.ZoomingRelativeHandleLocator
-
- All Implemented Interfaces:
org.eclipse.draw2d.Locator
public class ZoomingRelativeHandleLocator extends org.eclipse.draw2d.RelativeLocator implements org.eclipse.draw2d.LocatorA Locator, which sets the target bounds depending on the reference figure bounds according to the following rules:- The handle-insets are used to expand/shrink the reference figure bounds, at the beginning of the calculation. They are adjusted with the current zoom-level.
- The location can be one of the north-south-east-west constants in
PositionConstants. It describes the side/corner of the reference figure bounds at which the target is located. - The handle-dimension defines the dimension of the target bounds. They are adjusted with the current zoom-level.
-
-
Constructor Summary
Constructors Constructor Description ZoomingRelativeHandleLocator(org.eclipse.draw2d.IFigure reference, IConfigurationProvider configurationProvider, int location, org.eclipse.draw2d.geometry.Dimension handleDimension, org.eclipse.draw2d.geometry.Dimension handleInsets)Creates a new ZoomingInsetsHandleLocator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.eclipse.draw2d.geometry.RectanglegetReferenceBox()Returns the reference figure bounds adjusted by the insets.voidrelocate(org.eclipse.draw2d.IFigure target)Sets the bounds of the target figure as described above.
-
-
-
Constructor Detail
-
ZoomingRelativeHandleLocator
public ZoomingRelativeHandleLocator(org.eclipse.draw2d.IFigure reference, IConfigurationProvider configurationProvider, int location, org.eclipse.draw2d.geometry.Dimension handleDimension, org.eclipse.draw2d.geometry.Dimension handleInsets)Creates a new ZoomingInsetsHandleLocator.- Parameters:
reference- The target bounds are calculated depending on this reference figure.configurationProvider- The configuration provider which can be used to access the environment.location- The location can be one of the north-south-east-west constants inPositionConstants.handleDimension- The dimension of the target bounds.handleInsets- The insets to apply to the reference figure bounds.
-
-
Method Detail
-
getReferenceBox
protected org.eclipse.draw2d.geometry.Rectangle getReferenceBox()
Returns the reference figure bounds adjusted by the insets.- Overrides:
getReferenceBoxin classorg.eclipse.draw2d.RelativeLocator- Returns:
- The reference figure bounds adjusted by the insets.
-
relocate
public void relocate(org.eclipse.draw2d.IFigure target)
Sets the bounds of the target figure as described above.- Specified by:
relocatein interfaceorg.eclipse.draw2d.Locator- Overrides:
relocatein classorg.eclipse.draw2d.RelativeLocator- Parameters:
target- The target figure for which to set the bounds.
-
-