< prev index next >

modules/graphics/src/main/java/javafx/scene/paint/Material.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -23,10 +23,11 @@
  * questions.
  */
 
 package javafx.scene.paint;
 
+import com.sun.javafx.scene.paint.MaterialHelper;
 import com.sun.javafx.sg.prism.NGPhongMaterial;
 import javafx.application.ConditionalFeature;
 import javafx.application.Platform;
 import javafx.beans.property.BooleanProperty;
 import javafx.beans.property.SimpleBooleanProperty;

@@ -40,10 +41,33 @@
  * for more information.
  *
  * @since JavaFX 8.0
  */
 public abstract class Material {
+
+    static {
+        // This is used by classes in different packages to get access to
+        // private and package private methods.
+        MaterialHelper.setMaterialAccessor(new MaterialHelper.MaterialAccessor() {
+
+            @Override
+            public BooleanProperty dirtyProperty(Material material) {
+                return material.dirtyProperty();
+            }
+
+            @Override
+            public void updatePG(Material material) {
+                material.updatePG();
+            }
+            @Override
+            public NGPhongMaterial getNGMaterial(Material material) {
+                return material.getNGMaterial();
+            }
+
+        });
+    }
+
     /*
      *     Material (including Shaders and Textures)
      Material is not Paint
      PhongMaterial maybe the first and only material in FX8 (see 3D conceptual implementation for details)
      Bump map: Normal Map and Height Map -- We may generate a Normal Map when given a Height Map

@@ -70,28 +94,13 @@
 
     void setDirty(boolean value) {
         dirty.setValue(value);
     }
 
-    /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
-     */
-    @Deprecated
-    public final BooleanProperty impl_dirtyProperty() {
+    private final BooleanProperty dirtyProperty() {
         return dirty;
     }
 
-    /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
-     */
-    @Deprecated
-    abstract public void impl_updatePG();
+    abstract void updatePG();
 
-    /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
-     */
-    @Deprecated
-    abstract public NGPhongMaterial impl_getNGMaterial();
+    abstract NGPhongMaterial getNGMaterial();
 }
< prev index next >