public class TLcdGXYNavigateControllerModel extends Object
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.
Constructor and Description |
---|
TLcdGXYNavigateControllerModel() |
Modifier and Type | Method and Description |
---|---|
boolean |
transform(ILcdGXYView aGXYView,
List<Point> aPreviousAWTPoints,
List<Point> aCurrentAWTPoints,
boolean aShouldRotate,
boolean aShouldScale,
boolean aShouldTranslate)
Transform the view, based on the input points.
|
public boolean transform(ILcdGXYView aGXYView, List<Point> aPreviousAWTPoints, List<Point> aCurrentAWTPoints, boolean aShouldRotate, boolean aShouldScale, boolean aShouldTranslate)
aGXYView
- The view. The view must implement ILcdRotationCapableGXYView
in order to be rotated. If aGXYView
does not implement
this interface, no rotation will be applied, independent of the
aShouldRotate
parameteraPreviousAWTPoints
- List
containing the original location in view AWT
coordinates of the two input points. The List
must have
a length of 2, both points should have a different location and they
must not be null
. The order of the points must be the
same as the order in aCurrentAWTPoints
, e.g. the first
point in aPreviousAWTPoints
is moved to the location
specified as the first point in aCurrentAWTPoints
. The
points may remain stationary, e.g. it is not needed that the point in
aPreviousAWTPoints
and the corresponding point in
aCurrentAWTPoints
have a different location.aCurrentAWTPoints
- List
containing the location in view AWT coordinates of
the two input points after the transformation. The List
must have a length of 2, both points should have a different location
and they must not be null
. The order of the points must
be the same as the order in aPreviousAWTPoints
, e.g. the
first point aPreviousAWTPoints
is moved to the location
specified as the first point in aCurrentAWTPoints
. The
points may remain stationary, e.g. it is not needed that the point in
aPreviousAWTPoints
and the corresponding point in
aCurrentAWTPoints
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 appliedtrue
when the transformation was applied successfully, false
when the conditions are not met.