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.Locator
A 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
ConstructorDescriptionZoomingRelativeHandleLocator
(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
Modifier and TypeMethodDescriptionprotected org.eclipse.draw2d.geometry.Rectangle
Returns the reference figure bounds adjusted by the insets.void
relocate
(org.eclipse.draw2d.IFigure target) Sets the bounds of the target figure as described above.Methods inherited from class org.eclipse.draw2d.RelativeLocator
getReferenceFigure, setReferenceFigure
-
Constructor Details
-
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 Details
-
getReferenceBox
protected org.eclipse.draw2d.geometry.Rectangle getReferenceBox()Returns the reference figure bounds adjusted by the insets.- Overrides:
getReferenceBox
in 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:
relocate
in interfaceorg.eclipse.draw2d.Locator
- Overrides:
relocate
in classorg.eclipse.draw2d.RelativeLocator
- Parameters:
target
- The target figure for which to set the bounds.
-