Java 类com.badlogic.gdx.utils.Clipboard 实例源码

项目:ead    文件:MockApplication.java   
public MockApplication(ApplicationListener listener, int width, int height) {
    this.listener = listener;
    // Create stub objects
    files = new MockFiles();
    audio = new MockAudio();
    input = new MockInput();
    graphics = new MockGraphics(width, height);

    Gdx.app = this;
    Gdx.graphics = graphics;
    Gdx.files = files;
    Gdx.audio = audio;
    Gdx.input = input;
    Gdx.gl = graphics.getGL20();
    Gdx.gl20 = graphics.getGL20();
    GdxNativesLoader.load();
    clipboard = new Clipboard() {

        private String contents;

        @Override
        public String getContents() {
            return contents;
        }

        @Override
        public void setContents(String content) {
            this.contents = content;
        }
    };
    start();
}
项目:ZombieInvadersVR    文件:CardBoardAndroidApplication.java   
@Override
public Clipboard getClipboard () {
   if (clipboard == null) {
      clipboard = new AndroidClipboard(this);
   }
   return clipboard;
}
项目:Antiyoy    文件:LevelEditor.java   
public void importLevel() {
        String fromClipboard = "";

        Clipboard clipboard = Gdx.app.getClipboard();
        fromClipboard = clipboard.getContents();

//        if (YioGdxGame.ANDROID) {
//            GetAndroidClipboardContents getAndroidClipboardContents = new GetAndroidClipboardContents();
//            getAndroidClipboardContents.run();
//            while (!getAndroidClipboardContents.isComplete()) {
//                try {
//                    Thread.holdsLock(Thread.currentThread());
//                    Thread.currentThread().wait(100);
//                    System.out.println("waiting!!!!!");
//                } catch (InterruptedException e) {
//                    e.printStackTrace();
//                }
//            }
//            System.out.println("--------------------- 2");
//            fromClipboard = getAndroidClipboardContents.getResult();
//        } else {
//            Clipboard clipboard = Gdx.app.getClipboard();
//            fromClipboard = clipboard.getContents();
//        }

        if (isValidLevelString(fromClipboard)) {
            LoadingParameters instance = LoadingParameters.getInstance();
            instance.mode = LoadingParameters.MODE_EDITOR_LOAD;
            instance.applyFullLevel(fromClipboard);
            instance.colorOffset = 0;
            LoadingManager.getInstance().startGame(instance);
        }
    }
项目:Antiyoy    文件:LevelEditor.java   
public void exportLevel() {
        // this was not working properly
//        String fullLevel = getFullLevelString();

        Preferences prefs = Gdx.app.getPreferences(EDITOR_PREFS);
        String fullLevel = prefs.getString(SLOT_NAME + currentSlotNumber, "");
        System.out.println("fullLevel = " + fullLevel);
        Clipboard clipboard = Gdx.app.getClipboard();
        clipboard.setContents(fullLevel);
        Scenes.sceneNotification.showNotification("exported");
    }
项目:Antiyoy    文件:GetAndroidClipboardContents.java   
@Override
public void run() {
    handler.post(new Runnable() {
        @Override
        public void run() {
            Clipboard clipboard = Gdx.app.getClipboard();
            result = clipboard.getContents();
            complete = true;
            System.out.println("---------------------- 1");
        }
    });
}
项目:thunderboard-android    文件:GdxDemoActivity.java   
@Override
public Clipboard getClipboard() {
    if (clipboard == null) {
        clipboard = new AndroidClipboard(this);
    }
    return clipboard;
}
项目:libgdxcn    文件:JglfwClipboard.java   
public String getContents () {
    java.awt.datatransfer.Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    Transferable contents = clipboard.getContents(null);
    if (contents != null && contents.isDataFlavorSupported(DataFlavor.stringFlavor)) {
        try {
            return (String)contents.getTransferData(DataFlavor.stringFlavor);
        } catch (Exception ignored) {
        }
    }
    return "";
}
项目:libgdxcn    文件:IOSApplication.java   
@Override
public Clipboard getClipboard () {
    return new Clipboard() {
        @Override
        public void setContents (String content) {
            UIPasteboard.getGeneralPasteboard().setString(content);
        }

        @Override
        public String getContents () {
            return UIPasteboard.getGeneralPasteboard().getString();
        }
    };
}
项目:libgdxcn    文件:AndroidApplication.java   
@Override
public Clipboard getClipboard () {
    if (clipboard == null) {
        clipboard = new AndroidClipboard(this);
    }
    return clipboard;
}
项目:libgdxcn    文件:AndroidLiveWallpaper.java   
@Override
public Clipboard getClipboard () {
    if (clipboard == null) {
        clipboard = new AndroidClipboard(service);
    }
    return clipboard;
}
项目:libgdxcn    文件:AndroidFragmentApplication.java   
@Override
public Clipboard getClipboard () {
    if (clipboard == null) {
        clipboard = new AndroidClipboard(getActivity());
    }
    return clipboard;
}
项目:libgdxcn    文件:AndroidDaydream.java   
@Override
public Clipboard getClipboard () {
    if (clipboard == null) {
        clipboard = new AndroidClipboard(this);
    }
    return clipboard;
}
项目:vtm    文件:GwtApplication.java   
@Override
public Clipboard getClipboard() {
    return new Clipboard() {
        @Override
        public String getContents() {
            return null;
        }

        @Override
        public void setContents(String content) {
        }
    };
}
项目:mini2Dx    文件:IOSMini2DxGame.java   
@Override
public Clipboard getClipboard () {
    return new Clipboard() {
        @Override
        public void setContents (String content) {
            UIPasteboard.getGeneralPasteboard().setString(content);
        }

        @Override
        public String getContents () {
            return UIPasteboard.getGeneralPasteboard().getString();
        }
    };
}
项目:featurea    文件:MyLwjglCanvas.java   
public Clipboard getClipboard() {
    return new LwjglClipboard();
}
项目:gdx-backend-jglfw    文件:JglfwApplication.java   
public Clipboard getClipboard () {
    return clipboard;
}
项目:nvlist    文件:GdxAppStub.java   
@Override
public Clipboard getClipboard() {
    throw new UnsupportedOperationException();
}
项目:SquidLib-Demos    文件:GwtBareApp.java   
@Override
public Clipboard getClipboard() {
    return null;
}
项目:teavm-libgdx    文件:TeaVMApplication.java   
@Override
public Clipboard getClipboard() {
    // TODO Auto-generated method stub
    return null;
}
项目:libgdxcn    文件:TextField.java   
public void setClipboard (Clipboard clipboard) {
    this.clipboard = clipboard;
}
项目:libgdxcn    文件:JglfwClipboard.java   
public void setContents (String content) {
    java.awt.datatransfer.Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    clipboard.setContents(new StringSelection(content), this);
}
项目:libgdxcn    文件:JglfwClipboard.java   
public void lostOwnership (java.awt.datatransfer.Clipboard clipboard, Transferable transferable) {
}
项目:libgdxcn    文件:JglfwApplication.java   
public Clipboard getClipboard () {
    return clipboard;
}
项目:libgdxcn    文件:GwtApplication.java   
@Override
public Clipboard getClipboard () {
    return clipboard;
}
项目:libgdxcn    文件:HeadlessApplication.java   
@Override
public Clipboard getClipboard () {
    // no clipboards for headless apps
    return null;
}
项目:libgdxcn    文件:LwjglCanvas.java   
@Override
public Clipboard getClipboard () {
    return new LwjglClipboard();
}
项目:libgdxcn    文件:LwjglClipboard.java   
@Override
public void setContents (String content) {
    StringSelection stringSelection = new StringSelection(content);
    java.awt.datatransfer.Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    clipboard.setContents(stringSelection, this);
}
项目:libgdxcn    文件:LwjglClipboard.java   
@Override
public void lostOwnership (java.awt.datatransfer.Clipboard arg0, Transferable arg1) {
}
项目:libgdxcn    文件:LwjglAWTCanvas.java   
@Override
public Clipboard getClipboard () {
    return new LwjglClipboard();
}
项目:libgdxcn    文件:LwjglApplication.java   
@Override
public Clipboard getClipboard () {
    return new LwjglClipboard();
}
项目:libgdx-chat-example    文件:ChatTextField.java   
public void setClipboard (Clipboard clipboard) {
    this.clipboard = clipboard;
}
项目:gaiasky    文件:TextField.java   
public void setClipboard(Clipboard clipboard) {
    this.clipboard = clipboard;
}
项目:TinyVoxel    文件:GwtApplication.java   
@Override
public Clipboard getClipboard () {
    return clipboard;
}
项目:jaci    文件:ApplicationLoggingDecorator.java   
@Override
public Clipboard getClipboard() {
    return delegate.getClipboard();
}
项目:ead    文件:MockApplication.java   
@Override
public Clipboard getClipboard() {
    return clipboard;
}
项目:LibGDXServer    文件:ServerClipboard.java   
@Override
public void setContents(String content) {
    StringSelection stringSelection = new StringSelection(content);
    java.awt.datatransfer.Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
    clipboard.setContents(stringSelection, this);
}
项目:LibGDXServer    文件:ServerClipboard.java   
@Override
public void lostOwnership(java.awt.datatransfer.Clipboard arg0, Transferable arg1) {
}
项目:LibGDXServer    文件:ServerApplication.java   
@Override
public Clipboard getClipboard() {
    return new ServerClipboard();
}
项目:mini2Dx    文件:AndroidMini2DxGame.java   
@Override
public Clipboard getClipboard() {
    return clipboard;
}
项目:mini2Dx    文件:DesktopMini2DxGame.java   
@Override
public Clipboard getClipboard() {
    return new LwjglClipboard();
}