javafx-ui-quantum/src/com/sun/javafx/tk/quantum/QuantumToolkit.java

Print this page




  76 import com.sun.glass.ui.Screen;
  77 import com.sun.glass.ui.Timer;
  78 import com.sun.glass.ui.View;
  79 import com.sun.glass.ui.Window;
  80 import com.sun.javafx.PlatformUtil;
  81 import com.sun.javafx.embed.HostInterface;
  82 import com.sun.javafx.geom.Path2D;
  83 import com.sun.javafx.geom.PathIterator;
  84 import com.sun.javafx.geom.Shape;
  85 import com.sun.javafx.geom.transform.BaseTransform;
  86 import com.sun.javafx.perf.PerformanceTracker;
  87 import com.sun.javafx.runtime.async.AbstractRemoteResource;
  88 import com.sun.javafx.runtime.async.AsyncOperationListener;
  89 import com.sun.javafx.scene.text.HitInfo;
  90 import com.sun.javafx.scene.text.TextLayoutFactory;
  91 import com.sun.javafx.sg.PGArc;
  92 import com.sun.javafx.sg.PGCanvas;
  93 import com.sun.javafx.sg.PGCircle;
  94 import com.sun.javafx.sg.PGCubicCurve;
  95 import com.sun.javafx.sg.PGEllipse;

  96 import com.sun.javafx.sg.PGGroup;
  97 import com.sun.javafx.sg.PGImageView;
  98 import com.sun.javafx.sg.PGLine;
  99 import com.sun.javafx.sg.PGPath;
 100 import com.sun.javafx.sg.PGPolygon;
 101 import com.sun.javafx.sg.PGPolyline;
 102 import com.sun.javafx.sg.PGQuadCurve;
 103 import com.sun.javafx.sg.PGRectangle;
 104 import com.sun.javafx.sg.PGRegion;
 105 import com.sun.javafx.sg.PGSVGPath;
 106 import com.sun.javafx.sg.PGShape.StrokeLineCap;
 107 import com.sun.javafx.sg.PGShape.StrokeLineJoin;
 108 import com.sun.javafx.sg.PGShape.StrokeType;
 109 import com.sun.javafx.sg.PGText;
 110 import com.sun.javafx.sg.prism.NGArc;
 111 import com.sun.javafx.sg.prism.NGCanvas;
 112 import com.sun.javafx.sg.prism.NGCircle;
 113 import com.sun.javafx.sg.prism.NGCubicCurve;
 114 import com.sun.javafx.sg.prism.NGEllipse;
 115 import com.sun.javafx.sg.prism.NGGroup;


 170 import com.sun.javafx.sg.PGBox;
 171 import com.sun.javafx.sg.PGCylinder;
 172 import com.sun.javafx.sg.PGLightBase;
 173 import com.sun.javafx.sg.PGMeshView;
 174 import com.sun.javafx.sg.PGParallelCamera;
 175 import com.sun.javafx.sg.PGPerspectiveCamera;
 176 import com.sun.javafx.sg.PGPhongMaterial;
 177 import com.sun.javafx.sg.PGPointLight;
 178 import com.sun.javafx.sg.PGSphere;
 179 import com.sun.javafx.sg.PGTriangleMesh;
 180 import com.sun.javafx.sg.prism.NGAmbientLight;
 181 import com.sun.javafx.sg.prism.NGBox;
 182 import com.sun.javafx.sg.prism.NGCylinder;
 183 import com.sun.javafx.sg.prism.NGMeshView;
 184 import com.sun.javafx.sg.prism.NGParallelCamera;
 185 import com.sun.javafx.sg.prism.NGPerspectiveCamera;
 186 import com.sun.javafx.sg.prism.NGPhongMaterial;
 187 import com.sun.javafx.sg.prism.NGPointLight;
 188 import com.sun.javafx.sg.prism.NGSphere;
 189 import com.sun.javafx.sg.prism.NGTriangleMesh;

 190 
 191 public final class QuantumToolkit extends DesktopToolkit implements ToolkitInterface {
 192 
 193     public static final boolean verbose =
 194             AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
 195                 @Override public Boolean run() {
 196                     return Boolean.getBoolean("quantum.verbose");
 197                 }
 198             });
 199 
 200     public static final boolean pulseDebug =
 201             AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
 202                 @Override public Boolean run() {
 203                     return Boolean.getBoolean("quantum.pulse");
 204                 }
 205             });
 206 
 207     public static final boolean multithreaded =
 208             AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
 209                 @Override public Boolean run() {


1113     @Override public PGImageView createPGImageView() {
1114         return new NGImageView();
1115     }
1116 
1117     @Override public PGGroup createPGGroup() {
1118         return new NGGroup();
1119     }
1120 
1121     @Override public PGRegion createPGRegion() {
1122         return new NGRegion();
1123     }
1124 
1125     @Override public PGCanvas createPGCanvas() {
1126         return new NGCanvas();
1127     }
1128 
1129     @Override public PGText createPGText() {
1130         return new NGText();
1131     }
1132 




1133     @Override public Object createSVGPathObject(SVGPath svgpath) {
1134         int windingRule = svgpath.getFillRule() == FillRule.NON_ZERO ? PathIterator.WIND_NON_ZERO : PathIterator.WIND_EVEN_ODD;
1135         Path2D path = new Path2D(windingRule);
1136         path.appendSVGPath(svgpath.getContent());
1137         return path;
1138     }
1139 
1140     @Override public Path2D createSVGPath2D(SVGPath svgpath) {
1141         int windingRule = svgpath.getFillRule() == FillRule.NON_ZERO ? PathIterator.WIND_NON_ZERO : PathIterator.WIND_EVEN_ODD;
1142         Path2D path = new Path2D(windingRule);
1143         path.appendSVGPath(svgpath.getContent());
1144         return path;
1145     }
1146 
1147     @Override public boolean imageContains(Object image, float x, float y) {
1148         if (image == null) {
1149             return false;
1150         }
1151 
1152         com.sun.prism.Image pImage = (com.sun.prism.Image)image;




  76 import com.sun.glass.ui.Screen;
  77 import com.sun.glass.ui.Timer;
  78 import com.sun.glass.ui.View;
  79 import com.sun.glass.ui.Window;
  80 import com.sun.javafx.PlatformUtil;
  81 import com.sun.javafx.embed.HostInterface;
  82 import com.sun.javafx.geom.Path2D;
  83 import com.sun.javafx.geom.PathIterator;
  84 import com.sun.javafx.geom.Shape;
  85 import com.sun.javafx.geom.transform.BaseTransform;
  86 import com.sun.javafx.perf.PerformanceTracker;
  87 import com.sun.javafx.runtime.async.AbstractRemoteResource;
  88 import com.sun.javafx.runtime.async.AsyncOperationListener;
  89 import com.sun.javafx.scene.text.HitInfo;
  90 import com.sun.javafx.scene.text.TextLayoutFactory;
  91 import com.sun.javafx.sg.PGArc;
  92 import com.sun.javafx.sg.PGCanvas;
  93 import com.sun.javafx.sg.PGCircle;
  94 import com.sun.javafx.sg.PGCubicCurve;
  95 import com.sun.javafx.sg.PGEllipse;
  96 import com.sun.javafx.sg.PGExternalNode;
  97 import com.sun.javafx.sg.PGGroup;
  98 import com.sun.javafx.sg.PGImageView;
  99 import com.sun.javafx.sg.PGLine;
 100 import com.sun.javafx.sg.PGPath;
 101 import com.sun.javafx.sg.PGPolygon;
 102 import com.sun.javafx.sg.PGPolyline;
 103 import com.sun.javafx.sg.PGQuadCurve;
 104 import com.sun.javafx.sg.PGRectangle;
 105 import com.sun.javafx.sg.PGRegion;
 106 import com.sun.javafx.sg.PGSVGPath;
 107 import com.sun.javafx.sg.PGShape.StrokeLineCap;
 108 import com.sun.javafx.sg.PGShape.StrokeLineJoin;
 109 import com.sun.javafx.sg.PGShape.StrokeType;
 110 import com.sun.javafx.sg.PGText;
 111 import com.sun.javafx.sg.prism.NGArc;
 112 import com.sun.javafx.sg.prism.NGCanvas;
 113 import com.sun.javafx.sg.prism.NGCircle;
 114 import com.sun.javafx.sg.prism.NGCubicCurve;
 115 import com.sun.javafx.sg.prism.NGEllipse;
 116 import com.sun.javafx.sg.prism.NGGroup;


 171 import com.sun.javafx.sg.PGBox;
 172 import com.sun.javafx.sg.PGCylinder;
 173 import com.sun.javafx.sg.PGLightBase;
 174 import com.sun.javafx.sg.PGMeshView;
 175 import com.sun.javafx.sg.PGParallelCamera;
 176 import com.sun.javafx.sg.PGPerspectiveCamera;
 177 import com.sun.javafx.sg.PGPhongMaterial;
 178 import com.sun.javafx.sg.PGPointLight;
 179 import com.sun.javafx.sg.PGSphere;
 180 import com.sun.javafx.sg.PGTriangleMesh;
 181 import com.sun.javafx.sg.prism.NGAmbientLight;
 182 import com.sun.javafx.sg.prism.NGBox;
 183 import com.sun.javafx.sg.prism.NGCylinder;
 184 import com.sun.javafx.sg.prism.NGMeshView;
 185 import com.sun.javafx.sg.prism.NGParallelCamera;
 186 import com.sun.javafx.sg.prism.NGPerspectiveCamera;
 187 import com.sun.javafx.sg.prism.NGPhongMaterial;
 188 import com.sun.javafx.sg.prism.NGPointLight;
 189 import com.sun.javafx.sg.prism.NGSphere;
 190 import com.sun.javafx.sg.prism.NGTriangleMesh;
 191 import com.sun.javafx.sg.prism.NGExternalNode;
 192 
 193 public final class QuantumToolkit extends DesktopToolkit implements ToolkitInterface {
 194 
 195     public static final boolean verbose =
 196             AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
 197                 @Override public Boolean run() {
 198                     return Boolean.getBoolean("quantum.verbose");
 199                 }
 200             });
 201 
 202     public static final boolean pulseDebug =
 203             AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
 204                 @Override public Boolean run() {
 205                     return Boolean.getBoolean("quantum.pulse");
 206                 }
 207             });
 208 
 209     public static final boolean multithreaded =
 210             AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
 211                 @Override public Boolean run() {


1115     @Override public PGImageView createPGImageView() {
1116         return new NGImageView();
1117     }
1118 
1119     @Override public PGGroup createPGGroup() {
1120         return new NGGroup();
1121     }
1122 
1123     @Override public PGRegion createPGRegion() {
1124         return new NGRegion();
1125     }
1126 
1127     @Override public PGCanvas createPGCanvas() {
1128         return new NGCanvas();
1129     }
1130 
1131     @Override public PGText createPGText() {
1132         return new NGText();
1133     }
1134 
1135     @Override public PGExternalNode createPGExternalNode() {
1136         return new NGExternalNode();
1137     }
1138 
1139     @Override public Object createSVGPathObject(SVGPath svgpath) {
1140         int windingRule = svgpath.getFillRule() == FillRule.NON_ZERO ? PathIterator.WIND_NON_ZERO : PathIterator.WIND_EVEN_ODD;
1141         Path2D path = new Path2D(windingRule);
1142         path.appendSVGPath(svgpath.getContent());
1143         return path;
1144     }
1145 
1146     @Override public Path2D createSVGPath2D(SVGPath svgpath) {
1147         int windingRule = svgpath.getFillRule() == FillRule.NON_ZERO ? PathIterator.WIND_NON_ZERO : PathIterator.WIND_EVEN_ODD;
1148         Path2D path = new Path2D(windingRule);
1149         path.appendSVGPath(svgpath.getContent());
1150         return path;
1151     }
1152 
1153     @Override public boolean imageContains(Object image, float x, float y) {
1154         if (image == null) {
1155             return false;
1156         }
1157 
1158         com.sun.prism.Image pImage = (com.sun.prism.Image)image;