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
-
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 implementILcdRotationCapableGXYView
in order to be rotated. IfaGXYView
does not implement this interface, no rotation will be applied, independent of theaShouldRotate
parameteraPreviousAWTPoints
-List
containing the original location in view AWT coordinates of the two input points. TheList
must 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 inaPreviousAWTPoints
is moved to the location specified as the first point inaCurrentAWTPoints
. The points may remain stationary, e.g. it is not needed that the point inaPreviousAWTPoints
and the corresponding point inaCurrentAWTPoints
have a different location.aCurrentAWTPoints
-List
containing the location in view AWT coordinates of the two input points after the transformation. TheList
must 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 pointaPreviousAWTPoints
is moved to the location specified as the first point inaCurrentAWTPoints
. The points may remain stationary, e.g. it is not needed that the point inaPreviousAWTPoints
and the corresponding point inaCurrentAWTPoints
have a different location.aShouldRotate
-true
when the rotation part of the transformation should be appliedaShouldScale
-true
when the scaling part of the transformation should be appliedaShouldTranslate
-true
when the translation part of the transformation should be applied- Returns:
true
when the transformation was applied successfully,false
when the conditions are not met.
-