JDK-8102636 : Translate needs method to compare translations
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: scenegraph
  • Affected Version: 7u6
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2012-08-21
  • Updated: 2015-06-16
  • Resolved: 2012-10-18
Related Reports
Relates :  
Description
Translate needs method to compare translations. Something like String's compare method.
Comments
The similarTo method has been added in scope of RT-17942.
18-10-2012

Method's documentation: Checks if this transform is similar to the specified transform. The two transforms are considered similar if any point from range is transformed by them to points that are no farther than maxDelta from each other. Parameters: transform - transform to be compared to this transform range - region of interest on which the two transforms are compared maxDelta - maximum allowed distance for the results of transforming any single point from range by the two transforms .. the range is needed because for example for two scales with a tiny difference, you will always find a point with coordinates huge enough to transform to points farther from each other than a fixed maxDelta.
07-09-2012

I think yes. What is the purpose of range parameter?
06-09-2012

In scope of the RT-17942 effort, we will add Transform.similarTo(Transform transform, Bounds range, double maximumDelta). Would it be sufficient for resolving this issue?
06-09-2012

I wanted a method that would return true if transforms are equal and false otherwise.
21-08-2012

I don't see any obvious way to compare translations. The only reasonable semantics I can think of is comparing distances, but claiming that translating the same distance in different directions is "equal" would be pretty weird. Please specify what is your use-case and how do you expect it to behave.
21-08-2012