From d42a7779092255d64095c4225345f3cc75d4eb4a Mon Sep 17 00:00:00 2001 From: iwgeric Date: Fri, 12 Dec 2014 08:15:53 -0500 Subject: [PATCH] Add showSoftKeyboard(boolean show) to JmeSystem. Includes empty implementations for now. Android to be implemented in next commit. --- .../com/jme3/system/android/JmeAndroidSystem.java | 4 ++++ .../src/main/java/com/jme3/system/JmeSystem.java | 5 +++++ .../java/com/jme3/system/JmeSystemDelegate.java | 2 ++ .../java/com/jme3/system/JmeDesktopSystem.java | 14 +++++++++----- .../java/com/jme3/system/ios/JmeIosSystem.java | 7 ++++++- 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/jme3-android/src/main/java/com/jme3/system/android/JmeAndroidSystem.java b/jme3-android/src/main/java/com/jme3/system/android/JmeAndroidSystem.java index 6dadba841..a491a4158 100644 --- a/jme3-android/src/main/java/com/jme3/system/android/JmeAndroidSystem.java +++ b/jme3-android/src/main/java/com/jme3/system/android/JmeAndroidSystem.java @@ -230,4 +230,8 @@ public class JmeAndroidSystem extends JmeSystemDelegate { public static String getAudioRendererType() { return audioRendererType; } + + @Override + public void showSoftKeyboard(boolean show) { + } } diff --git a/jme3-core/src/main/java/com/jme3/system/JmeSystem.java b/jme3-core/src/main/java/com/jme3/system/JmeSystem.java index b0b4ce729..2e174efb6 100644 --- a/jme3-core/src/main/java/com/jme3/system/JmeSystem.java +++ b/jme3-core/src/main/java/com/jme3/system/JmeSystem.java @@ -103,6 +103,11 @@ public class JmeSystem { systemDelegate.setSoftTextDialogInput(input); } + public static void showSoftKeyboard(boolean show) { + checkDelegate(); + systemDelegate.showSoftKeyboard(show); + } + public static SoftTextDialogInput getSoftTextDialogInput() { checkDelegate(); return systemDelegate.getSoftTextDialogInput(); diff --git a/jme3-core/src/main/java/com/jme3/system/JmeSystemDelegate.java b/jme3-core/src/main/java/com/jme3/system/JmeSystemDelegate.java index 136ff152e..243b0434d 100644 --- a/jme3-core/src/main/java/com/jme3/system/JmeSystemDelegate.java +++ b/jme3-core/src/main/java/com/jme3/system/JmeSystemDelegate.java @@ -179,4 +179,6 @@ public abstract class JmeSystemDelegate { public abstract void initialize(AppSettings settings); public abstract ImageRaster createImageRaster(Image image, int slice); + + public abstract void showSoftKeyboard(boolean show); } diff --git a/jme3-desktop/src/main/java/com/jme3/system/JmeDesktopSystem.java b/jme3-desktop/src/main/java/com/jme3/system/JmeDesktopSystem.java index b7c3f38d6..39efea2ef 100644 --- a/jme3-desktop/src/main/java/com/jme3/system/JmeDesktopSystem.java +++ b/jme3-desktop/src/main/java/com/jme3/system/JmeDesktopSystem.java @@ -68,7 +68,7 @@ public class JmeDesktopSystem extends JmeSystemDelegate { public AssetManager newAssetManager(URL configFile) { return new DesktopAssetManager(configFile); } - + @Override public void writeImageFile(OutputStream outStream, String format, ByteBuffer imageData, int width, int height) throws IOException { BufferedImage awtImage = new BufferedImage(width, height, BufferedImage.TYPE_4BYTE_ABGR); @@ -96,7 +96,7 @@ public class JmeDesktopSystem extends JmeSystemDelegate { } }); } - + @Override public boolean showSettingsDialog(AppSettings sourceSettings, final boolean loadFromRegistry) { if (SwingUtilities.isEventDispatchThread()) { @@ -105,7 +105,7 @@ public class JmeDesktopSystem extends JmeSystemDelegate { final AppSettings settings = new AppSettings(false); settings.copyFrom(sourceSettings); - String iconPath = sourceSettings.getSettingsDialogImage(); + String iconPath = sourceSettings.getSettingsDialogImage(); if(iconPath == null){ iconPath = ""; } @@ -269,10 +269,10 @@ public class JmeDesktopSystem extends JmeSystemDelegate { } catch (InstantiationException ex) { logger.log(Level.SEVERE, "Failed to create context", ex); } - + return null; } - + @Override public AudioRenderer newAudioRenderer(AppSettings settings) { initialize(settings); @@ -328,4 +328,8 @@ public class JmeDesktopSystem extends JmeSystemDelegate { } logger.log(Level.INFO, "Running on {0}", getFullName()); } + + @Override + public void showSoftKeyboard(boolean show) { + } } diff --git a/jme3-ios/src/main/java/com/jme3/system/ios/JmeIosSystem.java b/jme3-ios/src/main/java/com/jme3/system/ios/JmeIosSystem.java index 521876584..b4b7906e1 100644 --- a/jme3-ios/src/main/java/com/jme3/system/ios/JmeIosSystem.java +++ b/jme3-ios/src/main/java/com/jme3/system/ios/JmeIosSystem.java @@ -71,7 +71,7 @@ public class JmeIosSystem extends JmeSystemDelegate { showDialog(message); System.err.println("JME APPLICATION ERROR:" + message); } - + private native void showDialog(String message); @Override @@ -110,4 +110,9 @@ public class JmeIosSystem extends JmeSystemDelegate { public ImageRaster createImageRaster(Image image, int slice) { throw new UnsupportedOperationException("Not supported yet."); } + + @Override + public void showSoftKeyboard(boolean show) { + throw new UnsupportedOperationException("Not supported yet."); + } } \ No newline at end of file