Package org.apache.sis.portrayal
Class TransformChangeEvent
Object
EventObject
PropertyChangeEvent
TransformChangeEvent
- All Implemented Interfaces:
- Serializable
A change in the "objective to display" transform that 
Canvas uses for rendering data.
 That transform is updated frequently following gestures events such as zoom, translation or rotation.
 All events fired by Canvas for the "objectiveToDisplay" property
 are instances of this class.
 This specialization provides methods for computing the difference between the old and new state.
 Multi-threading
This class is not thread-safe. All listeners should process this event in the same thread.- Since:
- 1.3
- See Also:
Defined in the sis-portrayal module
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumThe reason why the "objective to display" transform changed.
- 
Field SummaryFields inherited from class EventObjectsource
- 
Constructor SummaryConstructorsConstructorDescriptionTransformChangeEvent(Canvas source, LinearTransform oldValue, LinearTransform newValue, AffineTransform objective, AffineTransform display, TransformChangeEvent.Reason reason) Creates a new event for an incremental change of the "objective to display" property.TransformChangeEvent(Canvas source, LinearTransform oldValue, LinearTransform newValue, TransformChangeEvent.Reason reason) Creates a new event for a change of the "objective to display" property.
- 
Method SummaryModifier and TypeMethodDescriptionReturns the change from old display coordinates to new display coordinates.Returns the change in display coordinates as a Java2D affine transform.Gets the new "objective to display" transform.Returns the change from old objective coordinates to new objective coordinates.Returns the change in objective coordinates as a Java2D affine transform.Gets the old "objective to display" transform.Returns the reason why the "objective to display" transform changed.Returns the canvas on which this event initially occurred.Methods inherited from class PropertyChangeEventgetPropagationId, getPropertyName, setPropagationId, toString
- 
Constructor Details- 
TransformChangeEventpublic TransformChangeEvent(Canvas source, LinearTransform oldValue, LinearTransform newValue, TransformChangeEvent.Reason reason) Creates a new event for a change of the "objective to display" property. The old and new transforms should not be null, except on initialization or for lazy computation: a nullnewValuemeans to take the value fromCanvas.getObjectiveToDisplay()when needed.- Parameters:
- source- the canvas that fired the event.
- oldValue- the old "objective to display" transform, or- nullif none.
- newValue- the new transform, or- nullfor lazy computation.
- reason- the reason why the "objective to display" transform changed..
- Throws:
- IllegalArgumentException- if- sourceis- null.
 
- 
TransformChangeEventpublic TransformChangeEvent(Canvas source, LinearTransform oldValue, LinearTransform newValue, AffineTransform objective, AffineTransform display, TransformChangeEvent.Reason reason) Creates a new event for an incremental change of the "objective to display" property. The incremental change can be specified by theobjectiveand/or thedisplayargument. Usually only one of those two arguments is non-null.- Parameters:
- source- the canvas that fired the event.
- oldValue- the old "objective to display" transform, or- nullif none.
- newValue- the new transform, or- nullfor lazy computation.
- objective- the incremental change in objective coordinates, or- nullfor lazy computation.
- display- the incremental change in display coordinates, or- nullfor lazy computation.
- reason- the reason why the "objective to display" transform changed..
- Throws:
- IllegalArgumentException- if- sourceis- null.
 
 
- 
- 
Method Details- 
getSourceReturns the canvas on which this event initially occurred.- Overrides:
- getSourcein class- EventObject
- Returns:
- the canvas on which this event initially occurred.
 
- 
getReasonReturns the reason why the "objective to display" transform changed. It may be because of canvas initialization, or an adjustment for a change of CRS without change in the viewing area, or a navigation for viewing a different area.- Returns:
- the reason why the "objective to display" transform changed.
 
- 
getOldValueGets the old "objective to display" transform.- Overrides:
- getOldValuein class- PropertyChangeEvent
- Returns:
- the old "objective to display" transform, or nullif none.
 
- 
getNewValueGets the new "objective to display" transform. It should be the current value ofCanvas.getObjectiveToDisplay().- Overrides:
- getNewValuein class- PropertyChangeEvent
- Returns:
- the new "objective to display" transform.
 
- 
getObjectiveChangeReturns the change from old objective coordinates to new objective coordinates. When the "objective to display" transform changed (e.g. because the user did a zoom, translation or rotation), this method expresses how the "real world" coordinates (typically in metres) of any point on the screen changed.Example: if the map is shifted 10 metres toward the right side of the canvas, then (assuming no rotation or axis flip) the x translation coefficient of the change is +10 (same sign thanThegetDisplayChange()). Note that it may correspond to any amount of pixels, depending on the zoom factor.getObjectiveChange2D()method gives the same transform as a Java2D object. That change can be replicated on another canvas by giving the transform toPlanarCanvas.transformObjectiveCoordinates(AffineTransform).- Returns:
- the change in objective coordinates. Usually not null, unless one of the canvas is initializing or has a non-invertible transform.
 
- 
getDisplayChangeReturns the change from old display coordinates to new display coordinates. When the "objective to display" transform changed (e.g. because the user did a zoom, translation or rotation), this method expresses how the display coordinates (typically pixels) of any given point on the map changed.Example: if the map is shifted 10 pixels toward the right side of the canvas, then (assuming no rotation or axis flip) the x translation coefficient of the change is +10: the points on the map which were located at x=0 pixel before the change are now located at x=10 pixels after the change.ThegetDisplayChange2D()method gives the same transform as a Java2D object. That change can be replicated on another canvas by giving the transform toPlanarCanvas.transformDisplayCoordinates(AffineTransform).- Returns:
- the change in display coordinates. Usually not null, unless one of the canvas is initializing or has a non-invertible transform.
 
- 
getObjectiveChange2DReturns the change in objective coordinates as a Java2D affine transform. This method is suitable for two-dimensional canvas only. For performance reason, it does not clone the returned transform.- Returns:
- the change in objective coordinates. Do not modify.
- See Also:
 
- 
getDisplayChange2DReturns the change in display coordinates as a Java2D affine transform. This method is suitable for two-dimensional canvas only. For performance reason, it does not clone the returned transform.- Returns:
- the change in display coordinates. Do not modify.
- See Also:
 
 
-