< prev index next >

modules/graphics/src/main/java/com/sun/javafx/tk/quantum/QuantumToolkit.java

Print this page


   1 /*
   2  * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   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


  75 import java.util.function.Supplier;
  76 import com.sun.glass.ui.Application;
  77 import com.sun.glass.ui.Clipboard;
  78 import com.sun.glass.ui.ClipboardAssistance;
  79 import com.sun.glass.ui.CommonDialogs;
  80 import com.sun.glass.ui.CommonDialogs.FileChooserResult;
  81 import com.sun.glass.ui.EventLoop;
  82 import com.sun.glass.ui.Screen;
  83 import com.sun.glass.ui.Timer;
  84 import com.sun.glass.ui.View;
  85 import com.sun.javafx.PlatformUtil;
  86 import com.sun.javafx.application.PlatformImpl;
  87 import com.sun.javafx.embed.HostInterface;
  88 import com.sun.javafx.geom.Path2D;
  89 import com.sun.javafx.geom.PathIterator;
  90 import com.sun.javafx.geom.Shape;
  91 import com.sun.javafx.geom.transform.BaseTransform;
  92 import com.sun.javafx.perf.PerformanceTracker;
  93 import com.sun.javafx.runtime.async.AbstractRemoteResource;
  94 import com.sun.javafx.runtime.async.AsyncOperationListener;
  95 import com.sun.javafx.scene.text.HitInfo;
  96 import com.sun.javafx.scene.text.TextLayoutFactory;
  97 import com.sun.javafx.sg.prism.NGNode;
  98 import com.sun.javafx.tk.AppletWindow;
  99 import com.sun.javafx.tk.CompletionListener;
 100 import com.sun.javafx.tk.FileChooserType;
 101 import com.sun.javafx.tk.FontLoader;
 102 import com.sun.javafx.tk.ImageLoader;
 103 import com.sun.javafx.tk.PlatformImage;
 104 import com.sun.javafx.tk.RenderJob;
 105 import com.sun.javafx.tk.ScreenConfigurationAccessor;
 106 import com.sun.javafx.tk.TKClipboard;
 107 import com.sun.javafx.tk.TKDragGestureListener;
 108 import com.sun.javafx.tk.TKDragSourceListener;
 109 import com.sun.javafx.tk.TKDropTargetListener;
 110 import com.sun.javafx.tk.TKScene;
 111 import com.sun.javafx.tk.TKScreenConfigurationListener;
 112 import com.sun.javafx.tk.TKStage;
 113 import com.sun.javafx.tk.TKSystemMenu;
 114 import com.sun.javafx.tk.Toolkit;
 115 import com.sun.prism.BasicStroke;


1028                     struct.f2,
1029                     struct.f3);
1030             } else if (type == PathIterator.SEG_CUBICTO) {
1031                 el = new CubicCurveTo (
1032                     struct.f0,
1033                     struct.f1,
1034                     struct.f2,
1035                     struct.f3,
1036                     struct.f4,
1037                     struct.f5);
1038             } else if (type == PathIterator.SEG_CLOSE) {
1039                 el = new ClosePath();
1040             } else {
1041                 throw new IllegalStateException("Invalid element type: " + type);
1042             }
1043             helper.next();
1044             elements.add(el);
1045         }
1046 
1047         return elements.toArray(new PathElement[elements.size()]);
1048     }
1049 
1050     @Override public HitInfo convertHitInfoToFX(Object hit) {
1051         Integer textHitPos = (Integer) hit;
1052         HitInfo hitInfo = new HitInfo();
1053         hitInfo.setCharIndex(textHitPos);
1054         hitInfo.setLeading(true);
1055         return hitInfo;
1056     }
1057 
1058     @Override public Filterable toFilterable(Image img) {
1059         return PrImage.create((com.sun.prism.Image) img.impl_getPlatformImage());
1060     }
1061 
1062     @Override public FilterContext getFilterContext(Object config) {
1063         if (config == null || (!(config instanceof com.sun.glass.ui.Screen))) {
1064             return PrFilterContext.getDefaultInstance();
1065         }
1066         Screen screen = (Screen)config;
1067         return PrFilterContext.getInstance(screen);
1068     }
1069 
1070     @Override public AbstractMasterTimer getMasterTimer() {
1071         return MasterTimer.getInstance();
1072     }
1073 
1074     @Override public FontLoader getFontLoader() {
1075         return com.sun.javafx.font.PrismFontLoader.getInstance();


   1 /*
   2  * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   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


  75 import java.util.function.Supplier;
  76 import com.sun.glass.ui.Application;
  77 import com.sun.glass.ui.Clipboard;
  78 import com.sun.glass.ui.ClipboardAssistance;
  79 import com.sun.glass.ui.CommonDialogs;
  80 import com.sun.glass.ui.CommonDialogs.FileChooserResult;
  81 import com.sun.glass.ui.EventLoop;
  82 import com.sun.glass.ui.Screen;
  83 import com.sun.glass.ui.Timer;
  84 import com.sun.glass.ui.View;
  85 import com.sun.javafx.PlatformUtil;
  86 import com.sun.javafx.application.PlatformImpl;
  87 import com.sun.javafx.embed.HostInterface;
  88 import com.sun.javafx.geom.Path2D;
  89 import com.sun.javafx.geom.PathIterator;
  90 import com.sun.javafx.geom.Shape;
  91 import com.sun.javafx.geom.transform.BaseTransform;
  92 import com.sun.javafx.perf.PerformanceTracker;
  93 import com.sun.javafx.runtime.async.AbstractRemoteResource;
  94 import com.sun.javafx.runtime.async.AsyncOperationListener;

  95 import com.sun.javafx.scene.text.TextLayoutFactory;
  96 import com.sun.javafx.sg.prism.NGNode;
  97 import com.sun.javafx.tk.AppletWindow;
  98 import com.sun.javafx.tk.CompletionListener;
  99 import com.sun.javafx.tk.FileChooserType;
 100 import com.sun.javafx.tk.FontLoader;
 101 import com.sun.javafx.tk.ImageLoader;
 102 import com.sun.javafx.tk.PlatformImage;
 103 import com.sun.javafx.tk.RenderJob;
 104 import com.sun.javafx.tk.ScreenConfigurationAccessor;
 105 import com.sun.javafx.tk.TKClipboard;
 106 import com.sun.javafx.tk.TKDragGestureListener;
 107 import com.sun.javafx.tk.TKDragSourceListener;
 108 import com.sun.javafx.tk.TKDropTargetListener;
 109 import com.sun.javafx.tk.TKScene;
 110 import com.sun.javafx.tk.TKScreenConfigurationListener;
 111 import com.sun.javafx.tk.TKStage;
 112 import com.sun.javafx.tk.TKSystemMenu;
 113 import com.sun.javafx.tk.Toolkit;
 114 import com.sun.prism.BasicStroke;


1027                     struct.f2,
1028                     struct.f3);
1029             } else if (type == PathIterator.SEG_CUBICTO) {
1030                 el = new CubicCurveTo (
1031                     struct.f0,
1032                     struct.f1,
1033                     struct.f2,
1034                     struct.f3,
1035                     struct.f4,
1036                     struct.f5);
1037             } else if (type == PathIterator.SEG_CLOSE) {
1038                 el = new ClosePath();
1039             } else {
1040                 throw new IllegalStateException("Invalid element type: " + type);
1041             }
1042             helper.next();
1043             elements.add(el);
1044         }
1045 
1046         return elements.toArray(new PathElement[elements.size()]);








1047     }
1048 
1049     @Override public Filterable toFilterable(Image img) {
1050         return PrImage.create((com.sun.prism.Image) img.impl_getPlatformImage());
1051     }
1052 
1053     @Override public FilterContext getFilterContext(Object config) {
1054         if (config == null || (!(config instanceof com.sun.glass.ui.Screen))) {
1055             return PrFilterContext.getDefaultInstance();
1056         }
1057         Screen screen = (Screen)config;
1058         return PrFilterContext.getInstance(screen);
1059     }
1060 
1061     @Override public AbstractMasterTimer getMasterTimer() {
1062         return MasterTimer.getInstance();
1063     }
1064 
1065     @Override public FontLoader getFontLoader() {
1066         return com.sun.javafx.font.PrismFontLoader.getInstance();


< prev index next >