791 * image will be large enough to hold these dimensions
792 * scaled by the scale parameter.
793 * The depthBuffer specified in the params is used to determine
794 * with or without depthBuffer rendering should be performed.
795 * The root node is the root of a tree of toolkit-specific
796 * scene graph peer nodes to be rendered and should have
797 * been previously created by this toolkit.
798 * The platformPaint specified in the params must be
799 * generated by the appropriate Toolkit.createPaint method
800 * and is used to fill the background of the image before
801 * rendering the scene graph.
802 * The platformImage specified in the params may be non-null
803 * and should be a previous return value from this method.
804 * If it is non-null then it may be reused as the return value
805 * of this method if it is still valid and large enough to
806 * hold the requested size.
807 *
808 * @param context a ImageRenderingContext instance specifying
809 * the various rendering parameters
810 * @return a platform specific image object
811 * @see javafx.scene.image.Image#impl_fromPlatformImage
812 */
813
814 public abstract Object renderToImage(ImageRenderingContext context);
815
816 /**
817 * Returns the key code for the key which is commonly used on the
818 * corresponding platform as a modifier key in shortcuts. For example
819 * it is {@code KeyCode.CONTROL} on Windows (Ctrl + C, Ctrl + V ...) and
820 * {@code KeyCode.META} on MacOS (Cmd + C, Cmd + V ...).
821 *
822 * @return the key code for shortcut modifier key
823 */
824 public KeyCode getPlatformShortcutKey() {
825 return PlatformUtil.isMac() ? KeyCode.META : KeyCode.CONTROL;
826 }
827
828 public abstract FileChooserResult showFileChooser(
829 TKStage ownerWindow,
830 String title,
831 File initialDirectory,
931 public Object getPlatformPaint(Paint paint);
932 public void addListener(Paint paint, AbstractNotifyListener platformChangeListener);
933 public void removeListener(Paint paint, AbstractNotifyListener platformChangeListener);
934 }
935
936 private static PaintAccessor paintAccessor = null;
937
938 public static void setPaintAccessor(PaintAccessor accessor) {
939 paintAccessor = accessor;
940 }
941
942 public static PaintAccessor getPaintAccessor() {
943 return paintAccessor;
944 }
945
946 public interface ImageAccessor {
947 public boolean isAnimation(Image image);
948 public ReadOnlyObjectProperty<PlatformImage>getImageProperty(Image image);
949 public int[] getPreColors(PixelFormat<ByteBuffer> pf);
950 public int[] getNonPreColors(PixelFormat<ByteBuffer> pf);
951 }
952
953 private static ImageAccessor imageAccessor = null;
954
955 public static void setImageAccessor(ImageAccessor accessor) {
956 imageAccessor = accessor;
957 }
958
959 public static ImageAccessor getImageAccessor() {
960 return imageAccessor;
961 }
962
963 public String getThemeName() {
964 return null;
965 }
966 }
|
791 * image will be large enough to hold these dimensions
792 * scaled by the scale parameter.
793 * The depthBuffer specified in the params is used to determine
794 * with or without depthBuffer rendering should be performed.
795 * The root node is the root of a tree of toolkit-specific
796 * scene graph peer nodes to be rendered and should have
797 * been previously created by this toolkit.
798 * The platformPaint specified in the params must be
799 * generated by the appropriate Toolkit.createPaint method
800 * and is used to fill the background of the image before
801 * rendering the scene graph.
802 * The platformImage specified in the params may be non-null
803 * and should be a previous return value from this method.
804 * If it is non-null then it may be reused as the return value
805 * of this method if it is still valid and large enough to
806 * hold the requested size.
807 *
808 * @param context a ImageRenderingContext instance specifying
809 * the various rendering parameters
810 * @return a platform specific image object
811 * @see Toolkit.getImageAccessor().fromPlatformImage
812 */
813
814 public abstract Object renderToImage(ImageRenderingContext context);
815
816 /**
817 * Returns the key code for the key which is commonly used on the
818 * corresponding platform as a modifier key in shortcuts. For example
819 * it is {@code KeyCode.CONTROL} on Windows (Ctrl + C, Ctrl + V ...) and
820 * {@code KeyCode.META} on MacOS (Cmd + C, Cmd + V ...).
821 *
822 * @return the key code for shortcut modifier key
823 */
824 public KeyCode getPlatformShortcutKey() {
825 return PlatformUtil.isMac() ? KeyCode.META : KeyCode.CONTROL;
826 }
827
828 public abstract FileChooserResult showFileChooser(
829 TKStage ownerWindow,
830 String title,
831 File initialDirectory,
931 public Object getPlatformPaint(Paint paint);
932 public void addListener(Paint paint, AbstractNotifyListener platformChangeListener);
933 public void removeListener(Paint paint, AbstractNotifyListener platformChangeListener);
934 }
935
936 private static PaintAccessor paintAccessor = null;
937
938 public static void setPaintAccessor(PaintAccessor accessor) {
939 paintAccessor = accessor;
940 }
941
942 public static PaintAccessor getPaintAccessor() {
943 return paintAccessor;
944 }
945
946 public interface ImageAccessor {
947 public boolean isAnimation(Image image);
948 public ReadOnlyObjectProperty<PlatformImage>getImageProperty(Image image);
949 public int[] getPreColors(PixelFormat<ByteBuffer> pf);
950 public int[] getNonPreColors(PixelFormat<ByteBuffer> pf);
951 public Object getPlatformImage(Image image);
952 public Image fromPlatformImage(Object image);
953 }
954
955 private static ImageAccessor imageAccessor = null;
956
957 public static void setImageAccessor(ImageAccessor accessor) {
958 imageAccessor = accessor;
959 }
960
961 public static ImageAccessor getImageAccessor() {
962 return imageAccessor;
963 }
964
965 public String getThemeName() {
966 return null;
967 }
968 }
|