Class TLcdGXYNavigateControllerModel
Controller model to create navigation controllers for an ILcdGXYView.
The transformation which is applied on the view is based on the location of two distinct input points. When applying the rotation, scaling and translate operation on the view, the view will follow those input points. For example, when the first input point is set on location A of the view, and the second input point is set on location B of the view, moving the input points to a new location on screen will move A and B to the same new locations. Hence A remains always under the first input point, while B remains under the second input point.
It is possible to only apply certain parts of the transformation. Each transformation is composed of a rotation, scaling and translation. The transform method allows to specify which parts of the transformation should be applied. Only when all three operations are applied, the view will follow the input points completely.
- Since:
- 10.0
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
TLcdGXYNavigateControllerModel
public TLcdGXYNavigateControllerModel()
-
-
Method Details
-
transform
public boolean transform(ILcdGXYView aGXYView, List<Point> aPreviousAWTPoints, List<Point> aCurrentAWTPoints, boolean aShouldRotate, boolean aShouldScale, boolean aShouldTranslate) Transform the view, based on the input points.- Parameters:
aGXYView- The view. The view must implementILcdRotationCapableGXYViewin order to be rotated. IfaGXYViewdoes not implement this interface, no rotation will be applied, independent of theaShouldRotateparameteraPreviousAWTPoints-Listcontaining the original location in view AWT coordinates of the two input points. TheListmust have a length of 2, both points should have a different location and they must not benull. The order of the points must be the same as the order inaCurrentAWTPoints, e.g. the first point inaPreviousAWTPointsis moved to the location specified as the first point inaCurrentAWTPoints. The points may remain stationary, e.g. it is not needed that the point inaPreviousAWTPointsand the corresponding point inaCurrentAWTPointshave a different location.aCurrentAWTPoints-Listcontaining the location in view AWT coordinates of the two input points after the transformation. TheListmust have a length of 2, both points should have a different location and they must not benull. The order of the points must be the same as the order inaPreviousAWTPoints, e.g. the first pointaPreviousAWTPointsis moved to the location specified as the first point inaCurrentAWTPoints. The points may remain stationary, e.g. it is not needed that the point inaPreviousAWTPointsand the corresponding point inaCurrentAWTPointshave a different location.aShouldRotate-truewhen the rotation part of the transformation should be appliedaShouldScale-truewhen the scaling part of the transformation should be appliedaShouldTranslate-truewhen the translation part of the transformation should be applied- Returns:
truewhen the transformation was applied successfully,falsewhen the conditions are not met.
-