modules/graphics/src/test/java/javafx/scene/NodeTest.java

Print this page
rev 6167 : RT-35330 [Monocle] Remove StubToolkit and replace it with headless glass implementation


   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 javafx.scene;
  27 

  28 import com.sun.javafx.geom.BoxBounds;
  29 import com.sun.javafx.geom.PickRay;
  30 import com.sun.javafx.geom.transform.Affine2D;
  31 import com.sun.javafx.geom.transform.Affine3D;
  32 import com.sun.javafx.geom.transform.BaseTransform;
  33 import com.sun.javafx.geom.transform.Translate2D;
  34 import com.sun.javafx.pgstub.StubStage;
  35 import com.sun.javafx.pgstub.StubToolkit;
  36 import com.sun.javafx.scene.DirtyBits;
  37 import com.sun.javafx.scene.input.PickResultChooser;
  38 import com.sun.javafx.sg.prism.NGGroup;
  39 import com.sun.javafx.sg.prism.NGNode;
  40 import com.sun.javafx.sg.prism.NGRectangle;
  41 import com.sun.javafx.test.objects.TestScene;
  42 import com.sun.javafx.test.objects.TestStage;
  43 import com.sun.javafx.tk.Toolkit;
  44 import javafx.beans.property.*;
  45 import javafx.geometry.BoundingBox;
  46 import javafx.geometry.Bounds;
  47 import javafx.geometry.NodeOrientation;


  55 import org.junit.Rule;
  56 import org.junit.Test;
  57 import org.junit.rules.ExpectedException;
  58 
  59 import java.lang.reflect.Method;
  60 import java.util.Comparator;
  61 import javafx.scene.layout.AnchorPane;
  62 import javafx.scene.transform.Affine;
  63 import javafx.scene.transform.Scale;
  64 import javafx.scene.transform.Shear;
  65 import javafx.scene.transform.Translate;
  66 import javafx.stage.Stage;
  67 
  68 import static org.junit.Assert.*;
  69 import org.junit.Ignore;
  70 /**
  71  * Tests various aspects of Node.
  72  *
  73  */
  74 public class NodeTest {




  75     @Rule
  76     public ExpectedException thrown = ExpectedException.none();
  77 
  78     // Things to test:
  79         // When parent is changed, should cursor on toolkit change as well if
  80         // the current node has the mouse over it and didn't explicitly set a
  81         // cursor??
  82 
  83         // Test CSS integration
  84 
  85         // Events:
  86             // Events should *not* be delivered to invisible nodes as per the
  87             // specification for visible
  88 
  89         // A Node must lose focus when it is no longer visible
  90 
  91         // A node made invisible must cause the cursor to be updated
  92 
  93         // Setting the cursor should override the parent cursor when hover
  94         // (test that this happens both when the node already has hover set and




   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 javafx.scene;
  27 
  28 import com.sun.javafx.FXUnit;
  29 import com.sun.javafx.geom.BoxBounds;
  30 import com.sun.javafx.geom.PickRay;
  31 import com.sun.javafx.geom.transform.Affine2D;
  32 import com.sun.javafx.geom.transform.Affine3D;
  33 import com.sun.javafx.geom.transform.BaseTransform;
  34 import com.sun.javafx.geom.transform.Translate2D;
  35 import com.sun.javafx.pgstub.StubStage;
  36 import com.sun.javafx.pgstub.StubToolkit;
  37 import com.sun.javafx.scene.DirtyBits;
  38 import com.sun.javafx.scene.input.PickResultChooser;
  39 import com.sun.javafx.sg.prism.NGGroup;
  40 import com.sun.javafx.sg.prism.NGNode;
  41 import com.sun.javafx.sg.prism.NGRectangle;
  42 import com.sun.javafx.test.objects.TestScene;
  43 import com.sun.javafx.test.objects.TestStage;
  44 import com.sun.javafx.tk.Toolkit;
  45 import javafx.beans.property.*;
  46 import javafx.geometry.BoundingBox;
  47 import javafx.geometry.Bounds;
  48 import javafx.geometry.NodeOrientation;


  56 import org.junit.Rule;
  57 import org.junit.Test;
  58 import org.junit.rules.ExpectedException;
  59 
  60 import java.lang.reflect.Method;
  61 import java.util.Comparator;
  62 import javafx.scene.layout.AnchorPane;
  63 import javafx.scene.transform.Affine;
  64 import javafx.scene.transform.Scale;
  65 import javafx.scene.transform.Shear;
  66 import javafx.scene.transform.Translate;
  67 import javafx.stage.Stage;
  68 
  69 import static org.junit.Assert.*;
  70 import org.junit.Ignore;
  71 /**
  72  * Tests various aspects of Node.
  73  *
  74  */
  75 public class NodeTest {
  76 
  77     @Rule
  78     public FXUnit fx = new FXUnit();
  79 
  80     @Rule
  81     public ExpectedException thrown = ExpectedException.none();
  82 
  83     // Things to test:
  84         // When parent is changed, should cursor on toolkit change as well if
  85         // the current node has the mouse over it and didn't explicitly set a
  86         // cursor??
  87 
  88         // Test CSS integration
  89 
  90         // Events:
  91             // Events should *not* be delivered to invisible nodes as per the
  92             // specification for visible
  93 
  94         // A Node must lose focus when it is no longer visible
  95 
  96         // A node made invisible must cause the cursor to be updated
  97 
  98         // Setting the cursor should override the parent cursor when hover
  99         // (test that this happens both when the node already has hover set and