本文整理汇总了Java中com.badlogic.gdx.utils.Clipboard类的典型用法代码示例。如果您正苦于以下问题:Java Clipboard类的具体用法?Java Clipboard怎么用?Java Clipboard使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Clipboard类属于com.badlogic.gdx.utils包,在下文中一共展示了Clipboard类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MockApplication
import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
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();
}
示例2: getClipboard
import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
@Override
public Clipboard getClipboard () {
if (clipboard == null) {
clipboard = new AndroidClipboard(this);
}
return clipboard;
}
示例3: importLevel
import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
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);
}
}
示例4: exportLevel
import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
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");
}
示例5: run
import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
@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");
}
});
}
示例6: getClipboard
import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
@Override
public Clipboard getClipboard() {
if (clipboard == null) {
clipboard = new AndroidClipboard(this);
}
return clipboard;
}
示例7: getContents
import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
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 "";
}
示例8: getClipboard
import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
@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();
}
};
}
示例9: getClipboard
import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
@Override
public Clipboard getClipboard () {
if (clipboard == null) {
clipboard = new AndroidClipboard(this);
}
return clipboard;
}
示例10: getClipboard
import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
@Override
public Clipboard getClipboard () {
if (clipboard == null) {
clipboard = new AndroidClipboard(service);
}
return clipboard;
}
示例11: getClipboard
import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
@Override
public Clipboard getClipboard () {
if (clipboard == null) {
clipboard = new AndroidClipboard(getActivity());
}
return clipboard;
}
示例12: getClipboard
import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
@Override
public Clipboard getClipboard() {
return new Clipboard() {
@Override
public String getContents() {
return null;
}
@Override
public void setContents(String content) {
}
};
}
示例13: getClipboard
import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
public Clipboard getClipboard() {
return new LwjglClipboard();
}
示例14: getClipboard
import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
public Clipboard getClipboard () {
return clipboard;
}
示例15: getClipboard
import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
@Override
public Clipboard getClipboard() {
throw new UnsupportedOperationException();
}