modules/graphics/src/test/java/test/com/sun/javafx/sg/prism/ContentBoundsTest.java

Print this page
rev 9250 : 8134762: Refactor Javafx graphics module tests for clear separation of tests
Reviewed-by:


   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.javafx.sg.prism;
  27 
  28 import javafx.scene.Group;
  29 import javafx.scene.Node;
  30 import javafx.scene.Parent;
  31 import javafx.scene.Scene;
  32 import javafx.scene.shape.Rectangle;
  33 import com.sun.javafx.geom.BaseBounds;
  34 import com.sun.javafx.geom.RectBounds;
  35 import com.sun.javafx.geom.transform.Affine2D;
  36 import com.sun.javafx.geom.transform.BaseTransform;

  37 import org.junit.Test;
  38 import static org.junit.Assert.assertEquals;
  39 
  40 /**
  41  */
  42 public class ContentBoundsTest {
  43     public static final BaseTransform IDENTITY;
  44     public static final BaseTransform TRANSLATE;
  45     public static final BaseTransform SCALE;
  46     public static final BaseTransform ROTATE;
  47     public static final BaseTransform SCALE_TRANSLATE;
  48     public static final BaseTransform TRANSLATE_SCALE;
  49 
  50     public static BaseTransform translate(BaseTransform transform,
  51                                           double tx, double ty)
  52     {
  53         transform = BaseTransform.getInstance(transform);
  54         return transform.deriveWithConcatenation(1, 0, 0, 1, tx, ty);
  55     }
  56 




   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package test.com.sun.javafx.sg.prism;
  27 
  28 import javafx.scene.Group;
  29 import javafx.scene.Node;
  30 import javafx.scene.Parent;
  31 import javafx.scene.Scene;
  32 import javafx.scene.shape.Rectangle;
  33 import com.sun.javafx.geom.BaseBounds;
  34 import com.sun.javafx.geom.RectBounds;
  35 import com.sun.javafx.geom.transform.Affine2D;
  36 import com.sun.javafx.geom.transform.BaseTransform;
  37 import com.sun.javafx.sg.prism.NGNode;
  38 import org.junit.Test;
  39 import static org.junit.Assert.assertEquals;
  40 
  41 /**
  42  */
  43 public class ContentBoundsTest {
  44     public static final BaseTransform IDENTITY;
  45     public static final BaseTransform TRANSLATE;
  46     public static final BaseTransform SCALE;
  47     public static final BaseTransform ROTATE;
  48     public static final BaseTransform SCALE_TRANSLATE;
  49     public static final BaseTransform TRANSLATE_SCALE;
  50 
  51     public static BaseTransform translate(BaseTransform transform,
  52                                           double tx, double ty)
  53     {
  54         transform = BaseTransform.getInstance(transform);
  55         return transform.deriveWithConcatenation(1, 0, 0, 1, tx, ty);
  56     }
  57