当前位置: 首页>>代码示例>>Java>>正文


Java Clipboard类代码示例

本文整理汇总了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();
}
 
开发者ID:e-ucm,项目名称:ead,代码行数:33,代码来源:MockApplication.java

示例2: getClipboard

import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
@Override
public Clipboard getClipboard () {
   if (clipboard == null) {
      clipboard = new AndroidClipboard(this);
   }
   return clipboard;
}
 
开发者ID:raphaelbruno,项目名称:ZombieInvadersVR,代码行数:8,代码来源:CardBoardAndroidApplication.java

示例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);
        }
    }
 
开发者ID:yiotro,项目名称:Antiyoy,代码行数:34,代码来源:LevelEditor.java

示例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");
    }
 
开发者ID:yiotro,项目名称:Antiyoy,代码行数:12,代码来源:LevelEditor.java

示例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");
        }
    });
}
 
开发者ID:yiotro,项目名称:Antiyoy,代码行数:13,代码来源:GetAndroidClipboardContents.java

示例6: getClipboard

import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
@Override
public Clipboard getClipboard() {
    if (clipboard == null) {
        clipboard = new AndroidClipboard(this);
    }
    return clipboard;
}
 
开发者ID:SiliconLabs,项目名称:thunderboard-android,代码行数:8,代码来源:GdxDemoActivity.java

示例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 "";
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:12,代码来源:JglfwClipboard.java

示例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();
		}
	};
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:15,代码来源:IOSApplication.java

示例9: getClipboard

import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
@Override
public Clipboard getClipboard () {
	if (clipboard == null) {
		clipboard = new AndroidClipboard(this);
	}
	return clipboard;
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:8,代码来源:AndroidApplication.java

示例10: getClipboard

import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
@Override
public Clipboard getClipboard () {
	if (clipboard == null) {
		clipboard = new AndroidClipboard(service);
	}
	return clipboard;
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:8,代码来源:AndroidLiveWallpaper.java

示例11: getClipboard

import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
@Override
public Clipboard getClipboard () {
	if (clipboard == null) {
		clipboard = new AndroidClipboard(getActivity());
	}
	return clipboard;
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:8,代码来源:AndroidFragmentApplication.java

示例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) {
		}
	};
}
 
开发者ID:opensciencemap,项目名称:vtm,代码行数:14,代码来源:GwtApplication.java

示例13: getClipboard

import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
public Clipboard getClipboard() {
    return new LwjglClipboard();
}
 
开发者ID:dmitrykolesnikovich,项目名称:featurea,代码行数:4,代码来源:MyLwjglCanvas.java

示例14: getClipboard

import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
public Clipboard getClipboard () {
	return clipboard;
}
 
开发者ID:Arcnor,项目名称:gdx-backend-jglfw,代码行数:4,代码来源:JglfwApplication.java

示例15: getClipboard

import com.badlogic.gdx.utils.Clipboard; //导入依赖的package包/类
@Override
public Clipboard getClipboard() {
    throw new UnsupportedOperationException();
}
 
开发者ID:anonl,项目名称:nvlist,代码行数:5,代码来源:GdxAppStub.java


注:本文中的com.badlogic.gdx.utils.Clipboard类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。